Skip to content

Commit 3f51935

Browse files
committed
Initial commit
0 parents  commit 3f51935

15 files changed

+446
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Bug report
3+
about: Report a problem
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
A paragraph or two describing the bug.
11+
12+
## Reproduction
13+
Steps to reproduce the behavior:
14+
1. Go to '...'
15+
2. Click on '...'
16+
3. Scroll down to '...'
17+
4. See error
18+
19+
## Expected behaviour
20+
A clear and concise description of what you expected to happen.
21+
22+
## Actual behaviour
23+
Include current behaviour and output.
24+
25+
## Environment
26+
* `dynamodb-serialise`: version (run: `pip show dynamodb-serialise`)
27+
* Python: version (run: `python --version`)
28+
* OS: Windows 10 / Ubuntu 20.04 / OSX
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Feature request
3+
about: Request a feature
4+
title: ''
5+
labels: feature
6+
assignees: ''
7+
8+
---
9+
10+
A paragraph or two summarising the feature request.
11+
12+
## Problem definition
13+
14+
## Current behaviour and workarounds
15+
16+
## Proposed solution (optional)

.github/pull_request_template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
A paragraph or two summarising the changes.
2+
3+
Issue: reference
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python
13+
uses: actions/setup-python@v2
14+
- name: Build package
15+
run: |
16+
pip install build
17+
pyproject-build
18+
- name: Publish package
19+
env:
20+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
21+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
22+
run: |
23+
pip install twine
24+
twine upload dist/*
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
10+
- ver/*
11+
tags:
12+
- v*
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: [3.6, 3.7, 3.8, 3.9]
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install package
27+
run: pip install .
28+
- name: Run test suite
29+
run: |
30+
pip install -r tests/requirements.txt
31+
pytest -vvra
32+
- name: Lint with black
33+
run: |
34+
pip install black
35+
black --check src

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.idea/
2+
.venv
3+
setup.py
4+
dist/
5+
__pycache__/
6+
*.egg-info/

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 laurie_opperman@hotmail.com. 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: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Contribution guide
2+
Thanks for wanting to help out!
3+
4+
## Development environment set-up
5+
Create a new `setup.py`:
6+
```python
7+
from setuptools import setup
8+
9+
setup()
10+
```
11+
12+
Install package
13+
```shell
14+
pip install -e .
15+
```
16+
17+
Install package testing requirements
18+
```shell
19+
pip install -r tests/requirements.txt black
20+
```
21+
22+
## Testing
23+
Run the test suite
24+
```shell
25+
pytest -vvra
26+
```
27+
28+
Run linting
29+
```shell
30+
black --check src
31+
```
32+
33+
## Submitting changes
34+
Make sure the above test is successful, then make a pull-request on GitHub.

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright 2021 Laurie O
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7+
of the Software, and to permit persons to whom the Software is furnished to do
8+
so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# DynamoDB value serialisation and deserialisation
2+
Convert values from AWS DynamoDB to native Python types.
3+
4+
Makes more sensible decisions about numbers and binary values, at the cost of
5+
floating-point precision. Very lightweight.
6+
7+
## Installation
8+
```shell
9+
pip install dynamodb-serialise
10+
```
11+
12+
## Usage
13+
```python
14+
import dynamodb_serialise
15+
16+
dynamodb_serialise.deserialise(
17+
{"M": {"foo": {"N": "42"}, "bar": {"B": "c3BhbQ=="}}}
18+
)
19+
# {'foo': 42, 'bar': b'spam'}
20+
21+
dynamodb_serialise.serialise(
22+
{'foo': 42, 'bar': b'spam'}, bytes_to_base64=True
23+
)
24+
# {"M": {"foo": {"N": "42"}, "bar": {"B": "c3BhbQ=="}}}
25+
```

0 commit comments

Comments
 (0)