Giter VIP home page Giter VIP logo

curatedapi's Introduction

Example Package: Curated API

This package provides a Python interface for the Curated API. With it, you can easily manage issues, links, and subscribers within publications using the CuratedApi class.

Installation

To install the package, you can use pip:

pip install curatedapi_wm

Usage

To use the CuratedApi class within your Python project:

from curatedapi import CuratedApi

api_key = "YOUR_API_KEY"
curated_api = CuratedApi(api_key)

Make sure to replace "YOUR_API_KEY" with your actual Curated API key in order to gain access to your account via the API. Please see the documentation provided by Curated for getting started with the Curated API

Setting publication id

You must perform this step or you cannot communicate with the Curated API

To target any individual publication within the API you'll need to get its id from within Curated. You can also achieve this by reviewing the results from the following API call:

print(curated_api.request_all_publications())

This will return a JSON response containing all publications within your account. Choose the ID from the one you want to target and assign that to the curated_api instance you have created.

publication_id = "YOUR_PUBLICATION_ID"
curated_api.set_publication_id(publication_id)

Tests

The package comes with a set of tests. To run the tests:

  1. Navigate to the package directory.
  2. Run the test files using Python:
python -m unittest tests/test_curated_api.py
python -m unittest tests/test_curated_category.py
python -m unittest tests/test_curated_link.py

License

This package is licensed under the MIT license. See the LICENSE file for more details.

curatedapi's People

Contributors

williammincy 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.