Skip to content

Commit adf152c

Browse files
committed
First clean commit
0 parents  commit adf152c

34 files changed

Lines changed: 12786 additions & 0 deletions

CODE_OF_CONDUCT.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
As contributors of the Ironsource API Library project, we pledge to respect everyone who contributes by posting issues, updating documentation, submitting pull requests, providing feedback in comments, and any other activities.
2+
3+
Communication through any of Ironsource channels must be constructive and never resort to personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
4+
5+
We promise to extend courtesy and respect to everyone involved in this project regardless of gender, gender identity, sexual orientation, disability, age, race, ethnicity, religion, or level of experience. We expect anyone contributing to the Ironsource API Library project to do the same.
6+
7+
If any member of the community violates this code of conduct, the maintainers of the Ironsource API Library project may take action, removing issues, comments, and PRs or blocking accounts as deemed appropriate.

CONTRIBUTING.md

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
# Contributing to Ironsource API Library
2+
3+
We would love you to contribute to Ironsource API Library!
4+
As a contributor, here are the guidelines we would like you to follow:
5+
6+
- [Code of Conduct](#coc)
7+
- [Question or Problem?](#question)
8+
- [Issues and Bugs](#issue)
9+
- [Feature Requests](#feature)
10+
- [Submission Guidelines](#submit)
11+
- [Commit Message Guidelines](#commit)
12+
- [Signing the CLA](#cla)
13+
14+
15+
## <a name="coc"></a> Code of Conduct
16+
17+
Help us keep Ironsource API Library open and inclusive.
18+
Please read and follow our [Code of Conduct][coc].
19+
20+
21+
## <a name="question"></a> Got a Question or Problem?
22+
23+
Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests.
24+
Instead, [contact ironSource support](https://developers.is.com/submit-a-request)
25+
26+
## <a name="issue"></a> Found a Bug?
27+
28+
If you find a bug in the source code, you can help us by [submitting an issue](#submit-issue) to our [GitHub Repository][github].
29+
Even better, you can [submit a Pull Request](#submit-pr) with a fix.
30+
31+
32+
## <a name="feature"></a> Missing a Feature?
33+
You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub Repository.
34+
If you would like to *implement* a new feature, please consider the size of the change in order to determine the right steps to proceed:
35+
36+
* For a **Major Feature**, first open an issue and outline your proposal so that it can be discussed.
37+
This process allows us to better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project.
38+
39+
**Note**: Adding a new topic to the documentation, or significantly re-writing a topic, counts as a major feature.
40+
41+
* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
42+
43+
44+
## <a name="submit"></a> Submission Guidelines
45+
46+
47+
### <a name="submit-issue"></a> Submitting an Issue
48+
49+
Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.
50+
51+
We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it.
52+
In order to reproduce bugs, we require that you provide a minimal reproduction.
53+
Having a minimal reproducible scenario gives us a wealth of important information without going back and forth to you with additional questions.
54+
55+
A minimal reproduction allows us to quickly confirm a bug (or point out a coding problem) as well as confirm that we are fixing the right problem.
56+
57+
We require a minimal reproduction to save maintainers' time and ultimately be able to fix more bugs.
58+
Often, developers find coding problems themselves while preparing a minimal reproduction.
59+
We understand that sometimes it might be hard to extract essential bits of code from a larger codebase but we really need to isolate the problem before we can fix it.
60+
61+
Unfortunately, we are not able to investigate / fix bugs without a minimal reproduction, so if we don't hear back from you, we are going to close an issue that doesn't have enough info to be reproduced.
62+
63+
You can file new issues by selecting from our [new issue templates](https://github.com/ironSource/mobile-api-lib-python/issues/new/choose) and filling out the issue template.
64+
65+
66+
### <a name="submit-pr"></a> Submitting a Pull Request (PR)
67+
68+
Before you submit your Pull Request (PR) consider the following guidelines:
69+
70+
1. Search [GitHub](https://github.com/ironSource/mobile-api-lib-python/pulls) for an open or closed PR that relates to your submission.
71+
You don't want to duplicate existing efforts.
72+
73+
2. Be sure that an issue describes the problem you're fixing, or documents the design for the feature you'd like to add.
74+
Discussing the design upfront helps to ensure that we're ready to accept your work.
75+
76+
3. Please review our [Contributor License Agreement (CLA)](#cla) before sending PRs.
77+
**By creating a pull request you accept the *Contributor License Agreement (CLA)***
78+
79+
4. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) the angular/angular repo.
80+
81+
5. In your forked repository, make your changes in a new git branch:
82+
83+
```shell
84+
git checkout -b my-fix-branch main
85+
```
86+
87+
6. Create your patch, **including appropriate test cases**.
88+
89+
90+
7. Run the unit tests
91+
```shell
92+
npm run test
93+
```
94+
***optional:***
95+
If you have your own ironSource credentials that you wish to test with add them to your local .env
96+
```shell
97+
API_CI_SECRET=
98+
API_CI_TOKEN=
99+
API_CI_USER=
100+
```
101+
or
102+
```shell
103+
DEMO_ACCOUNT_SECRET=
104+
DEMO_ACCOUNT_TOKEN=
105+
DEMO_ACCOUNT_USER=
106+
```
107+
108+
then run:
109+
```shell
110+
npm run integrationTest
111+
```
112+
113+
8. Run lint:
114+
```shell
115+
npm run lint
116+
```
117+
118+
9. Commit your changes using a descriptive commit message that follows our [commit message conventions](#commit).
119+
Adherence to these conventions is necessary because release notes are automatically generated from these messages.
120+
121+
```shell
122+
git commit --all
123+
```
124+
Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
125+
126+
10. Push your branch to GitHub:
127+
128+
```shell
129+
git push origin my-fix-branch
130+
```
131+
132+
11. In GitHub, send a pull request to `ironSource/mobile-api-lib-python:main`.
133+
134+
### Reviewing a Pull Request
135+
136+
The Ironsource API Library team reserves the right not to accept pull requests from community members who haven't been good citizens of the community. Such behavior includes not following the [code of conduct][coc]
137+
138+
#### Addressing review feedback
139+
140+
If we ask for changes via code reviews then:
141+
142+
1. Make the required updates to the code.
143+
144+
2. Re-run the Ironsource API Library test to ensure tests are still passing.
145+
146+
3. Create a fixup commit and push to your GitHub repository (this will update your Pull Request):
147+
148+
```shell
149+
git commit --all --fixup HEAD
150+
git push
151+
```
152+
153+
That's it! Thank you for your contribution!
154+
155+
156+
157+
## <a name="commit"></a> Commit Message Format
158+
159+
Please follow the [conventional-commits format][commit]
160+
161+
Commit format:
162+
```
163+
<type>(<scope>): <short summary>
164+
│ │ │
165+
│ │ └─⫸ Summary in present tense. Not capitalized. No period at the end.
166+
│ │
167+
│ └─⫸ Commit Scope: component_name|service_name|feature_name|....
168+
169+
└─⫸ Commit Type: build|ci|feat|fix|refactor|test|perf
170+
```
171+
172+
The `<type>` and `<summary>` fields are mandatory, the `(<scope>)` field is optional.
173+
174+
175+
##### Type
176+
177+
Must be one of the following:
178+
179+
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
180+
* **ci**: Changes to our CI configuration files and scripts (example scopes: Circle, BrowserStack, SauceLabs)
181+
* **feat**: A new feature
182+
* **fix**: A bug fix
183+
* **perf**: A code change that improves performance
184+
* **refactor**: A code change that neither fixes a bug nor adds a feature
185+
* **test**: Adding missing tests or correcting existing tests
186+
187+
188+
##### Scope
189+
The scope should be the name of the npm module affected
190+
191+
192+
##### Summary
193+
194+
Use the summary field to provide a succinct description of the change:
195+
196+
* use the imperative, present tense: "change" not "changed" nor "changes"
197+
* don't capitalize the first letter
198+
* no dot (.) at the end
199+
200+
201+
#### <a name="commit-body"></a>Commit Message Body
202+
203+
204+
Explain the motivation for the change in the commit message body. This commit message should explain _why_ you are making the change.
205+
You can include a comparison of the previous behavior with the new behavior in order to illustrate the impact of the change.
206+
207+
208+
209+
### Revert commits
210+
211+
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit.
212+
213+
The content of the commit message body should contain:
214+
215+
- information about the SHA of the commit being reverted in the following format: `This reverts commit <SHA>`,
216+
- a clear description of the reason for reverting the commit message.
217+
218+
219+
220+
221+
[github]: https://github.com/ironSource/mobile-api-lib-python
222+
[coc]: https://github.com/ironSource/mobile-api-lib-python/blob/main/CODE_OF_CONDUCT.md
223+
[cla]: https://github.com/ironSource/opensource-contributor-license-agreement
224+
[commit]: https://www.conventionalcommits.org/en/v1.0.0/

MANIFEST.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include README.md
2+
include requirements.txt
3+
graft ironsource_api
4+
recursive-exclude * *.py[co]
5+
include versioneer.py
6+
include ironsource_api/_version.py

README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
2+
# ironsource_api_python
3+
![Test And Lint](https://github.com/ironSource/mobile-api-lib-python/actions/workflows/deploy.yml/badge.svg)
4+
5+
## Installation
6+
7+
This module is installed via pip:
8+
9+
```
10+
pip install ironsrc_mobile_api
11+
```
12+
13+
## Simple Example:
14+
```python
15+
import os
16+
from ironsource_api.ironsource_api import IronSourceAPI
17+
from ironsource_api.promote_api import Metrics, Breakdowns
18+
19+
ironsrc_api = IronSourceAPI()
20+
21+
ironsrc_api.set_credentials(API_USER, API_TOKEN,API_SECRET)
22+
23+
#Get Monetization Data
24+
res = ironsrc_api.monetize_api().get_monetization_data(start_date='2020-01-01', end_date='2020-01-01')
25+
26+
27+
#Get Advertiser Statistics
28+
bytes_io = ironsrc_api.promote_api().get_advertiser_statistics('2020-10-03','2020-10-04',
29+
[Metrics.Impressions,Metrics.Clicks,Metrics.Installs],
30+
[Breakdowns.Application,Breakdowns.Day],response_format='csv')
31+
32+
line = bytes_io_r.readline()
33+
34+
while len(line) > 0:
35+
print(line)
36+
line = bytes_io_r.readline()
37+
38+
bytes_io_r.close()
39+
40+
41+
42+
```
43+
#### Authentication
44+
Before starting to use the API make sure to get the credentials from ironSource dashboard.
45+
![Account Cred](https://developers.ironsrc.com/wp-content/uploads/2019/01/1-1.png)
46+
47+
And set the Access Key, Secret Key and Refresh Token:
48+
<a id="ironsource_api.IronSourceAPI.set_credentials"></a>
49+
50+
#### set\_credentials
51+
52+
```python
53+
def set_credentials(user: str, token: str, secret: str)
54+
```
55+
56+
sets credentials for the APIs
57+
58+
59+
<br>
60+
## Modules
61+
62+
* [IronSourceAPI](#ironsource_api.IronSourceAPI)
63+
* [monetize\_api](docs/monetize_api.md)
64+
* [promote\_api](docs/promote_api.md)
65+
66+
67+
<br>
68+
69+
## Contributing:
70+
Please follow contribution [guide](/CONTRIBUTING.md)
71+
72+
## Dependencies
73+
* [requests](https://github.com/psf/requests)
74+
* [httpx](https://github.com/encode/httpx)
75+
* [pydash](https://github.com/dgilland/pydash)

dev_requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
pytest~=6.2.5
2+
pytest-ordering~=0.6
3+
pylint~=2.7.4
4+
pytest-dotenv~=0.5.2
5+
versioneer~=0.22
6+
pytest-mock~=3.8.2
7+
pytest-asyncio~=0.19.0
8+
pytest-timeout~=2.1.0

0 commit comments

Comments
 (0)