A Python API Wrapper for the EgyTech.FYI API
Project description
Egytech API
A simple python wrapper for Egytech's API.
Description
- This python wrapper leverages the type safety and input validity checking of pydantic. It creates enums for all user-side inputs, making sure that all outgoing api requests are correct. It also leverages request pooling offered by httpx. This leads to more performant api requests when making multiple requests in a short period of time. This is my first project with pydantic. Feedback is appreciated.
- It also allows the user to extract the api call results as a pandas dataframe, making any visualization or data manipulation easier to do.
- You can extract the data in csv, or xslx format immediately. This uses pandas under the hood. However, you can extract a pandas dataframe and do whatever you want with it.
Getting Started
Dependencies
- This project uses python 3.11, any newer python version should work.
- This project is os-agnostic, it should work on any os with a python interpreter.
Installing
- To install with pip, run the following command:
pip install egytech_api
Quickstart
To make a simple API request that fetches survey data of participants who have a computer science degree and a "backend" job title, you can do the following:
from egytech_api.core import Participants
# Create a Participants object
participants = Participants(title="backend", cs_degree=True)
# Fetch the data
df = participants.get_df()
# Print the first 5 rows of the dataframe
df.head()
Full Documentation
The full documentation can be found here.
Examples
- Example
of
egytech_api.core.PoolingClient
usage in the docs and as a demo notebook. - This Colab notebook demonstrates how significantly using connection pooling alone or asynchronously can improve response time. Review results here.
To-Do
- Implement query response deserialization with pydantic models, leveraging fast type-safe deserialization as well as greater dumping flexibility.
- Implement an async-compatible PoolingClient, allowing for even faster performance with multiple asynchronous API calls.
- Make user imports for basic usage more developer-friendly.
- Implement other formats of data output (differently formatted DataFrame, ability to exclude and rename columns, ability to report na values across columns on client initialization among other features).
- Implement oauth2.0-compliant auth flow within the wrapper for future usage (in case the api implements auth in the future).
- Implement logging and custom error handling for better diagnostics.
License
This project is licensed under the MIT License - see the LICENSE file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
egytech_api-1.0.2.tar.gz
(7.0 kB
view details)
Built Distribution
File details
Details for the file egytech_api-1.0.2.tar.gz
.
File metadata
- Download URL: egytech_api-1.0.2.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a33379c5733b2ecd5e54506601a0bc18c00e19dea7b656760eacd1267ea8114 |
|
MD5 | 0946c78678519537d21bb095a42cd484 |
|
BLAKE2b-256 | cccdac6d28d26063401f0145a86a61bad700b672e449984a68946f710b3be31f |
File details
Details for the file egytech_api-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: egytech_api-1.0.2-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33adbd84c0ef4b209b9866f4892efbda919b6e22b784e27752a0e7b38c20bb6e |
|
MD5 | 545aab85583fdef2a381f430fcfa493b |
|
BLAKE2b-256 | 48f2746ba62e875e3cbfea7724b0f43d794a91a0b40c545a7ebbc978ba13bc61 |