Skip to content

Commit 3d60914

Browse files
AlexandreAhAlexandreAh
AlexandreAh
authored and
AlexandreAh
committed
Initial Commit
0 parents  commit 3d60914

File tree

161 files changed

+9095
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+9095
-0
lines changed

.gitignore

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Editor and Linter files
2+
.vscode/
3+
.mypy_cache/
4+
.pylintrc
5+
6+
# System files
7+
docs/.DS_Store
8+
.DS_Store
9+
10+
11+
# Development files
12+
temp/
13+
script.py
14+
15+
16+
# Jupyter Notebooks
17+
notebooks/*
18+
.ipynb_checkpoints/
19+
20+
21+
# Build files
22+
__pycache__/
23+
*.pyc
24+
radarly_py.egg-info/
25+
dist/
26+
build/
27+
docs/_build

LICENSE

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Copyright © 2018, Linkfluence SAS
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders X be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.
8+
9+
Except as contained in this notice, the name of the Linkfluence SAS shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the Linkfluence SAS.

MANIFEST.in

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include radarly/assets/categories.json
2+
include README.rst
3+
include LICENSE

README.rst

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
==========
2+
radarly-py
3+
==========
4+
5+
:Author: Linkfluence SAS
6+
:Version: 1.0.0
7+
8+
.. _documentation: https://api.linkfluence.com/
9+
10+
This package is a Python's client in order to use Radarly's API. Thanks to this client, you can fetch most of the endpoints described in the `documentation`_ of Radarly's API.
11+
12+
13+
Installation
14+
^^^^^^^^^^^^
15+
You can use ``pip`` to install this package. The commmand ``pip install radarly-py`` will install the package and all its dependencies.
16+
17+
.. note:: ``pandas`` is not a dependency of ``radarly-py`` but it is strongly advise to use to explore all objects
18+
storing quantitative datas.
19+
20+
21+
Quickstart
22+
^^^^^^^^^^
23+
First thing first you must initialize an API.
24+
25+
>>> from radarly import RadarlyApi
26+
>>> credentials = dict(client_id="XXXXX", client_secret="XXXXX")
27+
>>> RadarlyApi.init(**credentials)
28+
<RadarlyAPI.client_id=XXXXXXX>
29+
30+
Then you can explore the Radarly's API with the different objects defined by the client.
31+
32+
For example, you can explore all informations about you (your projects, your settings...).
33+
34+
>>> from radarly.user import User
35+
>>> me = User.find(uid='me')
36+
>>> me
37+
<User.id=1.email='[email protected]'>
38+
>>> me.draw_structure(max_depth=1)
39+
User (User)
40+
| account_id (int)
41+
| apps (list[str])
42+
| can_create_project (bool)
43+
| connected (int)
44+
| connection_count (int)
45+
| created (datetime)
46+
| current_project_id (int)
47+
| email (str)
48+
| engagement (dict)
49+
| id (int)
50+
| is_disabled (bool)
51+
| is_internal (bool)
52+
| is_manager (bool)
53+
| is_pending (bool)
54+
| is_root (bool)
55+
| level (str)
56+
| locale (str)
57+
| name (str)
58+
| picture_id (None)
59+
| projects (list[InfoProject])
60+
| theme (str)
61+
| timezone (Europe/Paris)
62+
| updated (datetime)
63+
64+
65+
Then, you can explore a specific project.
66+
67+
>>> from radarly.project import Project
68+
>>> my_project = Project.find(pid=2)
69+
>>> my_project
70+
<Project.pid=2.label=IGIT>
71+
>>> my_project.draw_structure(max_depth=1)
72+
Project (Project)
73+
| account_id (int)
74+
| alcmeon_company (str)
75+
| benchmark_entities (list[dict])
76+
| brand_logos (list)
77+
| client_reference (str)
78+
| corpora (list[dict])
79+
| created (datetime)
80+
| credentials (dict)
81+
| dashboards (list[Dashboard])
82+
| docs_count (int)
83+
| docs_version (int)
84+
| flags (dict)
85+
| focuses (list[Focus])
86+
| id (int)
87+
| industries (list[dict])
88+
| label (str)
89+
| limits (dict)
90+
| milestones (list[dict])
91+
| mm3_id (None)
92+
| out_of_reach_count (int)
93+
| picture_id (int)
94+
| platforms (list[str])
95+
| project_manager_id (int)
96+
| renew (datetime)
97+
| research_manager_id (int)
98+
| sinaweibo_options (dict)
99+
| social_accounts (list[SocialAccount])
100+
| social_wall_text (str)
101+
| start (datetime)
102+
| stop (datetime)
103+
| tags (list[Tag])
104+
| total_indexed_docs_count (int)
105+
| updated (datetime)
106+
>>> my_project['$.focuses.id'][:5] # Top five focuses'id in the project
107+
[154262, 154263, 154374, 5, 140519]
108+
109+
110+
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).
111+
112+
>>> from radarly.parameters import SearchPublicationParameter()
113+
>>> from datetime import datetime
114+
>>> start, end = datetime(2017, 1, 1), datetime(2017, 31, 12)
115+
>>> parameter = SearchPublicationParameter() \
116+
.publication_date(start, end) \
117+
.pagination(start=0, limit=5) \
118+
.focuses(include=[137622])
119+
>>> publications = project.get_publications(parameter)
120+
>>> publications
121+
[<Publication.uid='r3_prod_2-10...6268444865350'>,
122+
<Publication.uid='r3_prod_2-10...6268441960350'>,
123+
<Publication.uid='r3_prod_2-989433433368748032'>,
124+
<Publication.uid='r3_prod_2-10...6268434280350'>,
125+
<Publication.uid='r3_prod_2-10...6268433470350'>]
126+
127+
128+
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 you can do.

docs/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = Radarly-py
8+
SOURCEDIR = source
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "./" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "./" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/_static/favicon.ico

1.12 KB
Binary file not shown.

docs/_static/radarly.png

20.7 KB
Loading

docs/_static/radarly_api_scheme.png

105 KB
Loading

docs/_static/radarly_api_scheme.svg

+2
Loading
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
.http-example .caption,
3+
.section ul .http-example .caption {
4+
display: inline-block;
5+
cursor: pointer;
6+
padding: 0.5em 1em;
7+
margin: 0;
8+
}
9+
.http-example .caption.selected {
10+
font-weight: bold;
11+
background-color: #fff;
12+
border: 1px solid #e1e4e5;
13+
border-bottom: 1px solid white;
14+
}
15+
.http-example div[class^='highlight'] {
16+
margin-top: -1px;
17+
}
18+
.http-example div[class^='highlight'] pre {
19+
white-space: normal;
20+
}
21+
.http-example div.highlight-bash pre {
22+
white-space: pre-wrap;
23+
}
24+
.http-example-http div[class^='highlight'] pre,
25+
.http-example-response div[class^='highlight'] pre {
26+
white-space: pre;
27+
}
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
(function() {
2+
var jQuery = window.jQuery || function() {};
3+
4+
jQuery(function($) {
5+
$('.http-example.container').each(function() {
6+
var $container = $(this),
7+
$blocks = $(this).children(),
8+
$captions = $(this).find('.caption');
9+
$captions.each(function() {
10+
var $block = $(this).parent();
11+
$(this).on('click', function() {
12+
$captions.removeClass('selected');
13+
$(this).addClass('selected');
14+
$blocks.hide();
15+
$block.show();
16+
});
17+
$container.append($(this));
18+
});
19+
$container.append($blocks);
20+
$captions.first().click();
21+
});
22+
});
23+
24+
})();

docs/_static/theme_override.css

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* .wy-nav-content {
2+
max-width: 100%;
3+
} */
4+
/* .wy-side-nav-search {
5+
background-color: #343131 !important;
6+
} */
7+
8+
.wy-table-responsive table td,
9+
.wy-table-responsive table th {
10+
white-space: initial;
11+
}
12+
13+
.green {
14+
color:#00d82f;
15+
}
16+
17+
.blue {
18+
color: #0098e2;
19+
}

0 commit comments

Comments
 (0)