A lib for free APIs
Project description
pyfree
- A simple package to get data from OPEN APIs for your test projects or exp projects. No need to remember the URLS.
Functions
from pyfree import FreeAPI
FreeAPI.get_bank_details('SBIN0012345')
- to get bank details
How to create a PyPi package and Host it on pyPi server
- READ kro yeh - https://packaging.python.org/tutorials/packaging-projects/
- create a package with all the modules inside it.
- create LICENSE, README.md, setup.py, etc (with content from above URL or from my repo)
- Generating distribution archives -
python setup.py sdist bdist_wheel
- will create 2 files(source archive
andwheels
) inside dist/. These are the file that will be pushed to the server - create a acount for TestPYPI -
https://test.pypi.org/account/register/
- Upload to test-PYpi using twine. (install twine if not installed) .
OPTIONAL - twine check dist/*
andtwine upload --repository testpypi dist/*
- It should be uploaded and follow the steps that you see after upload to test or install your package in local.
- You have successfully installed and uploaded package to TestPypi. Follow the same steps for
https://pypi.org/account/register/
notes
- A common way to distribute is to -
source archive
andwheels
files
setup.py
- setup.py is the build script for setuptools. It tells setuptools about your package (such as the name and version) as well as which code files to includesetup.cfg
- a configuration forsetup.py
. More at - https://stackoverflow.com/questions/39484863/whats-the-difference-between-setup-py-and-setup-cfg-in-python-projects and https://docs.python.org/3/distutils/configfile.html.pypirc
- A .pypirc file allows you to define the configuration for package indexes (referred to here as “repositories”), so that you don’t have to enter the URL, username, or password whenever you upload a package with twine or flit. - https://packaging.python.org/specifications/pypirc/. (we place it in ~/.pypirc) (after adding it i just had to do twine upload and it take token and other credential from HOME/.pyprc file)MANIFEST.in
- a file where we list all the extra file that needs to be included__main__.py
andentrypoint
in setup.py - It enables excution of the main file with the module name directly with-m
flag. Eg -python -m pyfree
will execute content ofmain
inside__main__.py
file
setuptools
- setuptools (which includes easy_install) is a collection of enhancements to the Python distutils that allow you to more easily build and distribute Python distributions, especially ones that have dependencies on other packages.
Twine
- Twine is the primary tool developers use to upload packages to the Python Package Index or other Python package indexes. It is a command-line program that passes program files and metadata to a web API. Developers use it because it’s the official PyPI upload tool, it’s fast and secure, it’s maintained, and it reliably works.
wheel
- Primarily, the wheel project offers the bdist_wheel setuptools extension for creating wheel distributions. Additionally, it offers its own command line utility for creating and installing wheels.
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
pyfree-1.0.0.tar.gz
(3.6 kB
view hashes)
Built Distribution
pyfree-1.0.0-py3-none-any.whl
(4.7 kB
view hashes)