Giter Site home page Giter Site logo

advancedware-assignment's Introduction

AdvancedWare-Assignment

Random User Data Generator and Sorter

This project contains Python code to generate random user data, save it to a CSV file, and sort the data based on a specified field.

Getting Started

These instructions will help you get a copy of the project up and running on your local machine.

Prerequisites

You need to have the following packages installed on your machine:

requests
pandas
You can install these packages using the following command:

pip install requests pandas

pip install requests // probably preinstalled.

Generating User Data

The generate_random_user_data function uses the Random User Data API (https://random-data-api.com/documentation) to get random user data. The function takes two arguments:

num_users: The number of users to generate data for. interval: The interval time in seconds between each request to the API. The generated user data is saved to a CSV file named "users.csv".

Sorting User Data

The sort_csv function sorts the user data in the "users.csv" file based on a specified field. The function takes two arguments:

file_path: The path to the CSV file to sort. sort_field: The field to sort the data on. The sorted user data is saved to a new CSV file named "users-sorted.csv".

Displaying User Data

The get_user_details function takes an username as input and returns the details of the user from the "users.csv" file.

Running the Examples

You can run the examples in the AdvancedWare.ipynb notebook file to see the functions in action.

Conclusion

This project demonstrates the use of the requests and pandas packages to generate, sort, and retrieve user data from a CSV file. By using this project, you can easily generate and sort large amounts of random user data for testing and demonstration purposes.

advancedware-assignment's People

Contributors

jayesh-maiyani avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.