Find Jobs
Hire Freelancers

[Python] I need someone to help count items from response [json]

$10-30 AUD

Completed
Posted over 5 years ago

$10-30 AUD

Paid on delivery
Here's what I need help with: - I have a program, that looks inside of a response, if it finds an ID matching my list, it will print and save the name I have given the ID. It works well actually, where I need help with is if an ID is found twice, it will only print/save it once, when I'd like it saved twice. Ideally I'd like it to save it in the following format: Id1 x1 <found1 Id2 x1 <found1 Id 3 x2,3,4,5 ect <found2,3,4,5, ect Code being used: IDs = {'NameHere':'IdHere', 'NameHere':'IdHere', 'NameHere':'IdHere',} M = [k for (k, c) in sorted([login to view URL]()) if c in [login to view URL]] print M ^Printing that when used with my requests, will only print items from my list if any are found, I'd like a way implemented to add quantities, saving them with x1, x2, x3 ect. Ideal output: Bobx1 Gregx3 Billyx2 Script to test with: realresponse = { "cards": [{ "id": 1, "card_id": 2, "exp": 0, "skill_lv": 1, "released_rate": 0.0, "awakenings": [], "unlocked_square_statuses": [], "created_at": 1546646705, "potential_parameters": [] }] } IDs = {'Bob': '123', 'Billy': '456', 'Greg': '789'} sample = {'123', '789', '123'} M = [k for (k, c) in sorted([login to view URL]()) if c in sample] print M realresponse is not used, its there to show what a real response I get looks like. I can provide clearer information privately.
Project ID: 18466507

About the project

3 proposals
Remote project
Active 5 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Worked with python last 5 years, familiar with API responses and handling - last 3 projects required it
$25 AUD in 1 day
5.0 (1 review)
3.8
3.8
3 freelancers are bidding on average $20 AUD for this job
User Avatar
i am gopinath i have 3+ year experience in software development unity3d,android,ios...............................................................................................
$15 AUD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
Hello, I've read your offer and it seems like a simple task, so it can be done briefly. I have around 3 years of python experience. I have integrated APIs using json format many times, so what you're asking for is not a problem. If I understand correctly, multiple instances of the same ID are only being counted as one, right?
$20 AUD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of AUSTRALIA
canberra, Australia
5.0
2
Member since Jan 3, 2019

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.