Skip to content

Commit cc6b476

Browse files
committed
Initial commit
version 0.2.1 OAuth 2 Accounting API Identity API Exception handling
1 parent 7986053 commit cc6b476

File tree

299 files changed

+70741
-33
lines changed

Some content is hidden

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

299 files changed

+70741
-33
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
charset = utf-8
11+
end_of_line = lf
12+
13+
[*.bat]
14+
indent_style = tab
15+
end_of_line = crlf
16+
17+
[LICENSE]
18+
insert_final_newline = false
19+
20+
[Makefile]
21+
indent_style = tab

.gitignore

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ __pycache__/
88

99
# Distribution / packaging
1010
.Python
11+
env/
1112
build/
1213
develop-eggs/
1314
dist/
@@ -20,12 +21,9 @@ parts/
2021
sdist/
2122
var/
2223
wheels/
23-
pip-wheel-metadata/
24-
share/python-wheels/
2524
*.egg-info/
2625
.installed.cfg
2726
*.egg
28-
MANIFEST
2927

3028
# PyInstaller
3129
# Usually these files are written by a python script from a template
@@ -40,14 +38,12 @@ pip-delete-this-directory.txt
4038
# Unit test / coverage reports
4139
htmlcov/
4240
.tox/
43-
.nox/
4441
.coverage
4542
.coverage.*
4643
.cache
4744
nosetests.xml
4845
coverage.xml
4946
*.cover
50-
*.py,cover
5147
.hypothesis/
5248
.pytest_cache/
5349

@@ -58,8 +54,6 @@ coverage.xml
5854
# Django stuff:
5955
*.log
6056
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
6357

6458
# Flask stuff:
6559
instance/
@@ -77,38 +71,22 @@ target/
7771
# Jupyter Notebook
7872
.ipynb_checkpoints
7973

80-
# IPython
81-
profile_default/
82-
ipython_config.py
83-
8474
# pyenv
8575
.python-version
8676

87-
# pipenv
88-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91-
# install all needed dependencies.
92-
#Pipfile.lock
93-
94-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95-
__pypackages__/
96-
97-
# Celery stuff
77+
# celery beat schedule file
9878
celerybeat-schedule
99-
celerybeat.pid
10079

10180
# SageMath parsed files
10281
*.sage.py
10382

104-
# Environments
83+
# dotenv
10584
.env
85+
86+
# virtualenv
10687
.venv
107-
env/
10888
venv/
10989
ENV/
110-
env.bak/
111-
venv.bak/
11290

11391
# Spyder project settings
11492
.spyderproject
@@ -122,8 +100,14 @@ venv.bak/
122100

123101
# mypy
124102
.mypy_cache/
125-
.dmypy.json
126-
dmypy.json
127103

128-
# Pyre type checker
129-
.pyre/
104+
# IDE settings
105+
.vscode/
106+
.idea/
107+
108+
# openapi code generator specifics
109+
xeroapi-sdk-codegen/
110+
111+
# test specific configuration files
112+
/tests/oauth2_client.py
113+
/tests/oauth2_token.py

AUTHORS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Credits
2+
3+
## Development Lead
4+
5+
* Xero Developer API <[email protected]>
6+
7+
## Contributors
8+
9+
None yet. Why not be the first?

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# Contributing to Xero-Python
2+
We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:
3+
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
4+
5+
We want to make contributing to this project as easy and transparent as possible, whether it's:
6+
7+
The following is a set of guidelines for contributing to Xero and its projects, which are hosted in the [XeroAPI Organization](https://github.com/XeroAPI) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
8+
9+
### Table Of Contents
10+
[Code of Conduct](#code-of-conduct)
11+
12+
[I don't want to read this whole thing, I just have a question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question)
13+
14+
[How Can I Contribute?](#how-can-i-contribute)
15+
* [Reporting Bugs](#reporting-bugs)
16+
* [Suggesting Enhancements](#suggesting-enhancements)
17+
* [Pull Requests](#pull-requests)
18+
* [Local installation](#local-installation)
19+
20+
21+
## Code of Conduct
22+
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
23+
24+
## I don't want to read this whole thing I just have a question!!!
25+
26+
> **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below.
27+
28+
We have an official [message board](https://community.xero.com/developer) where Xero API support and the community chimes in with helpful advice if you have questions.
29+
30+
* [API Documentation](https://developer.xero.com/documentation/)
31+
* [Xero FAQ](https://developer.xero.com/faq)
32+
* [Community, the official Xero message board](https://community.xero.com/developer)
33+
* [Stackoverflow - Xero related](https://stackoverflow.com/questions/tagged/xero-api?sort=Newest)
34+
* [Submit requests for support](https://developer.xero.com/contact-xero-developer-platform-support/) to our API Support team.
35+
36+
# How Can I Contribute?
37+
38+
You can contribute by reporting bugs, suggesting enhancements, improving documentation i.e. [README](README.md) or submitting a pull request.
39+
40+
41+
## Reporting Bugs
42+
43+
Bugs are tracked as issues in this repository.
44+
45+
Before opening a new issue:
46+
* **check [the README](README.md)** to see if the behavior you observed might be expected and if configuration options are available to provide you with the desired behavior.
47+
48+
* **perform a cursory search** to see if there's [an existing issue](https://github.com/xero-github/xero-python/issues) covering your feedback. If there is one and the issue is still open, **add a :+1: reaction** on the issue to express interest in the issue being resolved. That will help the team gauge interest without the noise of comments which trigger notifications to all watchers. Comments should be used only if you have new and useful information to share.
49+
50+
### Write bug reports with detail, background, and sample code
51+
52+
- Which version of the SDK are you using?
53+
- A quick summary and/or background
54+
- Steps to reproduce
55+
- Be specific!
56+
- Give sample code if you can.
57+
- What you expected would happen
58+
- What actually happens
59+
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
60+
61+
## Suggesting Enhancements
62+
63+
When opening an issue for a feature request:
64+
* **use a clear and descriptive title** for the issue to identify the problem.
65+
* **include as many details as possible in the body**. Explain your use-case, the problems you're hitting and the solutions you'd like to see to address those problems.
66+
67+
## Pull requests
68+
69+
We welcome your feedback and pull requests. Be aware some code is generated and pull requests may not be the best solution - see below.
70+
71+
### We Use OpenAPI Generator
72+
The best way to propose changes to the codebase is to open an [issue](https://github.com/XeroAPI/xero-python/issues) and discuss with our team.
73+
74+
We are using [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) and [our OpenAPI specs](https://github.com/XeroAPI/Xero-OpenAPI), to create and update our models and client classes. Improvements may require updates to our OAS or our customized mustache templates instead of modifying via pull request.
75+
76+
### Submit a pull request
77+
78+
1. Fork and clone the repository
79+
1. Create a new branch: `git checkout -b my-branch-name`
80+
1. Make your change, add tests if needed
81+
1. Make sure the tests pass on your machine: `tox` read more in [local installation](#local-installation).
82+
1. Push to your fork and submit a pull request
83+
1. Pat your self on the back and wait for your pull request to be reviewed and merged.
84+
85+
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
86+
87+
- Follow the [style guide](#style-guide).
88+
- Write tests.
89+
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
90+
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
91+
92+
### Style Guide
93+
94+
* 4 spaces for indentation rather than tabs
95+
* See [.editorconfig](.editorconfig) for more styling rules
96+
* We us [black](https://github.com/psf/black) code formatter and
97+
[flake8](https://flake8.pycqa.org/en/latest/) to enforce style requirements.
98+
* Activate virtual environment by running `source venv/bin/activate`
99+
* Execute `flake8 xero_python tests` to check your code passes style requirements.
100+
* If you see `BLK100 Black would make changes.` error Execute `black <file/path.py>` to correct it.
101+
102+
### Local development requirements
103+
104+
* Python3.5+ installed.
105+
106+
### Local installation
107+
108+
* To speed up local tests install [libyaml](https://pyyaml.org/wiki/LibYAML) library.
109+
```bash
110+
brew install libyaml # Mac with Homebrew
111+
apt-get install libyaml-dev # Ubuntu
112+
dnf install libyaml-devel # Fedora
113+
```
114+
* Create new python virtual environment `python3 -m venv venv`
115+
* Activate new virtual environment by running `source venv/bin/activate`
116+
* Install project dependencies by running `pip install -r requirements.txt -r requirements/dev.txt`
117+
118+
### Running tests
119+
* Activate virtual environment by running `source venv/bin/activate`
120+
* Execute `pytest` to run tests.
121+
122+
### Running tests for all python versions
123+
* We use [tox](https://tox.readthedocs.io/en/latest/) to create different python environments and execute tests.
124+
125+
#### Local installation requirements
126+
* You need to have python interpreters for python 3.5, 3.6, 3.7, and 3.8 installed locally.
127+
* You can install them using [pyenv](https://github.com/pyenv/pyenv)
128+
* Install `pyenv` - follow https://github.com/pyenv/pyenv#installation
129+
* Install python versions required
130+
```bash
131+
pyenv install 3.5.9 && \
132+
pyenv install 3.6.10 && \
133+
pyenv install 3.7.6 && \
134+
pyenv install 3.8.2
135+
```
136+
137+
#### Running all tests
138+
* Activate pyenv installed python versions `pyenv local 3.5.9 3.6.10 3.7.6 3.8.2`
139+
* Activate virtual environment by running `source venv/bin/activate`
140+
* Execute `tox` to run all tests in all python versions
141+
142+
## License
143+
By contributing, you agree that your contributions will be licensed under its MIT License.

HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## History
2+
3+
### 0.1.0 (2020-03-02)
4+
* First release on PyPI.

LICENSE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Xero Developer API
3+
Copyright (c) 2020, Xero Developer API
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22+

MANIFEST.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
include AUTHORS.md
2+
include HISTORY.md
3+
include LICENSE
4+
include README.md
5+
include requirements.txt
6+
7+
recursive-include tests *
8+
recursive-exclude * __pycache__
9+
recursive-exclude * *.py[co]
10+
11+
recursive-include docs *.md conf.py Makefile make.bat *.jpg *.png *.gif

0 commit comments

Comments
 (0)