Python client for Radarly API
Project description
- Author:
Linkfluence
- Version:
1.0.17
This package is a Python client in order to use Radarly API. Thanks to this client, you can fetch most of the endpoints described in the documentation.
Installation
You can use pip to install this package. The commmand pip install radarly-py will install the package and all its dependencies.
Quickstart
First thing first, you must initialize an API.
>>> from radarly import RadarlyApi >>> credentials = dict(client_id="XXXXX", client_secret="XXXXX") >>> RadarlyApi.init(**credentials) <RadarlyAPI.client_id=XXXXXXX>
Then, you can explore Radarly API with the different objects defined by the client.
For example, you can explore all information about you (your projects, your settings…).
>>> from radarly.user import User >>> me = User.find(uid='me') >>> me <User.id=1.email='user.email@company.com'> >>> me.draw_structure(max_depth=1) User (User) | account_id (int) | apps (list[str]) | can_create_project (bool) | connected (int) | connection_count (int) | created (datetime) | current_project_id (int) | email (str) | engagement (dict) | id (int) | is_disabled (bool) | is_internal (bool) | is_manager (bool) | is_pending (bool) | is_root (bool) | level (str) | locale (str) | name (str) | picture_id (None) | projects (list[InfoProject]) | theme (str) | timezone (Europe/Paris) | updated (datetime)
Then, you can explore a specific project.
>>> from radarly.project import Project >>> my_project = Project.find(pid=2) >>> my_project <Project.pid=2.label=IGIT> >>> my_project.draw_structure(max_depth=1) Project (Project) | account_id (int) | alcmeon_company (str) | benchmark_entities (list[dict]) | brand_logos (list) | client_reference (str) | corpora (list[dict]) | created (datetime) | credentials (dict) | dashboards (list[Dashboard]) | docs_count (int) | docs_version (int) | flags (dict) | focuses (list[Focus]) | id (int) | industries (list[dict]) | label (str) | limits (dict) | milestones (list[dict]) | mm3_id (None) | out_of_reach_count (int) | picture_id (int) | platforms (list[str]) | project_manager_id (int) | renew (datetime) | research_manager_id (int) | sinaweibo_options (dict) | social_accounts (list[SocialAccount]) | social_wall_text (str) | start (datetime) | stop (datetime) | tags (list[Tag]) | total_indexed_docs_count (int) | updated (datetime) >>> my_project['$.focuses.id'][:5] # Top five focuses'id in the project [154262, 154263, 154374, 5, 140519]
You can now get some publications stored in this project. For example, we will retrieve five publications of the project, published in 2017 and matching the query with the id 137622 (see project['focuses'] to explore the queries of your project).
>>> from radarly.parameters import SearchPublicationParameter() >>> from datetime import datetime >>> start, end = datetime(2017, 1, 1), datetime(2017, 31, 12) >>> parameter = SearchPublicationParameter() \ .publication_date(start, end) \ .pagination(start=0, limit=5) \ .focuses(include=[137622]) >>> publications = project.get_publications(parameter) >>> publications [<Publication.uid='r3_prod_2-10...6268444865350'>, <Publication.uid='r3_prod_2-10...6268441960350'>, <Publication.uid='r3_prod_2-989433433368748032'>, <Publication.uid='r3_prod_2-10...6268434280350'>, <Publication.uid='r3_prod_2-10...6268433470350'>]
This client gives you many possibilities to explore and navigate in our API. Plese read the official documentation of the API and the client to check all that is possible.
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
File details
Details for the file radarly-py-1.0.17.tar.gz
.
File metadata
- Download URL: radarly-py-1.0.17.tar.gz
- Upload date:
- Size: 49.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67c3cb85aa489ab78e3e88a91be36c6cca6787c10983e21a4c2312cec8ec1c28 |
|
MD5 | 0d9c6200e1e69c4939a9231bfe92c0b7 |
|
BLAKE2b-256 | dbc348f3294ccb645b9e3c4c53c584e61cd64bffe543f939c4264818407a1522 |
File details
Details for the file radarly_py-1.0.17-py3-none-any.whl
.
File metadata
- Download URL: radarly_py-1.0.17-py3-none-any.whl
- Upload date:
- Size: 65.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 357b7616fef51adc82234a4f4ef83db5000cf135c6caffbecfad947b52dc5799 |
|
MD5 | 23358af77c68c5a2d4f558a48fa4de15 |
|
BLAKE2b-256 | b9df014793896fffc4510c2db6ef4e7dbf8dd7d2b33ec022c3ce9b48b3f4f003 |