A python package to interact with Medium API
Project description
pymediumapi
Table of Contents
About The Project
pymediumapi is a Python3 package to interact with the API of Medium
Getting Started
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
Prerequisites
Make sure to have python3
, pip
installed.
Installation
- Get a free Integration token at https://medium.com/ and create an enviroment variable
export MEDIUM_INTEGRATION_TOKEN=<your token>
- Clone the repo
git clone https://github.com/andregri/pymediumapi.git
- Create a virtual environment and install requirements
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
Usage
Example to authenticate and get a list of pubblications you subscribed:
import os
import pymediumapi
def main():
client = pymediumapi.Client(os.environ.get('MEDIUM_INTEGRATION_TOKEN'))
try:
client.authenticate()
except Exception as e:
print("Failed authentication: " + str(e))
quit()
try:
pubblications = client.get_pubblications()
except Exception as e:
print("Failed get pubblications: " + str(e))
quit()
if pubblications:
pub_id = pubblications[0]["id"]
try:
contributors = client.get_contributors(pub_id)
except Exception as e:
print("Failed getting contributors: " + str(e))
else:
print(contributors)
else:
print("There are no pubblications")
quit()
if __name__ == "__main__":
main()
Roadmap
- [] Upload post under pubblications
- [] Upload images
- [] Upload the package
See the open issues for a full list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE.md
for more information.
Contact
Andrea Grillo - @AndreaGrillo96
Project Link: https://github.com/andregri/pymediumapi
Acknowledgments
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
Built Distribution
Hashes for pymediumapi-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2209da5e873c3be5330aa20039ad484cc9f99117a855b322c438fdf8a852ce7d |
|
MD5 | 04ac2d042e893304a41a2b7063852d12 |
|
BLAKE2b-256 | de6ea9d7eff30e6700f90e3fb0325460cd6ff2da5b794d83d7540029b94bd427 |