Skip to content

Commit 75f218c

Browse files
committed
Update a README File
0 parents  commit 75f218c

File tree

148 files changed

+24139
-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.

148 files changed

+24139
-0
lines changed

.git-blame-ignore-revs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# .git-blame-ignore-revs
2+
# apply black to code base
3+
008c07f606365e624e95ff25d66f72d36625e708
4+
# apply black to tests
5+
260f4731126a501283498b6868fea82448ebf4a7

.github/resources/images/logo.png

17.7 KB
Loading
Loading

.github/workflows/release-to-pypi.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Checkout master, create sdist and bdist, and release to pypi
2+
3+
name: Release to PyPi & Deploy docs
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
pypi-target:
8+
description: Deploy to PyPi [Main] or [Test]
9+
required: true
10+
default: 'Main'
11+
push:
12+
tags:
13+
- v*.*
14+
15+
jobs:
16+
deploy-pypi:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python
21+
uses: actions/[email protected]
22+
with:
23+
python-version: '3.11'
24+
- name: Create dist
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install twine build
28+
python -m build
29+
- name: Validate dist
30+
run: twine check dist/*
31+
- if: github.event.inputs.pypi-target == 'Main' || github.event_name == 'push'
32+
name: Publish to PyPi
33+
env:
34+
TWINE_USERNAME: __token__
35+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
36+
run: |
37+
twine upload dist/*
38+
- if: github.event.inputs.pypi-target == 'Test'
39+
name: Publish to Test-PyPi
40+
env:
41+
TWINE_USERNAME: __token__
42+
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_API_TOKEN }}
43+
run: |
44+
twine upload --repository testpypi dist/*
45+
- if: github.event.inputs.pypi-target == 'Main' || github.event_name == 'push'
46+
name: Configure AWS credentials
47+
uses: aws-actions/configure-aws-credentials@v1
48+
with:
49+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
50+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
51+
aws-region: eu-north-1
52+
- if: github.event.inputs.pypi-target == 'Main' || github.event_name == 'push'
53+
name: Publish docs
54+
run: |
55+
pip install awscli
56+
pip install .[docs]
57+
mkdocs build -f docs/mkdocs.yml
58+
make docs-deploy
+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
push:
7+
branches:
8+
- master
9+
workflow_dispatch:
10+
11+
jobs:
12+
setup:
13+
name: Setup ${{ matrix.os }} Python ${{ matrix.python-version }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-20.04, windows-latest]
18+
python-version: ["3.11", "3.12"]
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v3
22+
with:
23+
path: 'mamba'
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/[email protected]
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
check-latest: true
29+
- if: matrix.os == 'ubuntu-20.04'
30+
name: Setup install dependencies
31+
run: |
32+
cd mamba
33+
python -m venv venv
34+
source venv/bin/activate
35+
pip install -e .[dev,docs]
36+
- if: matrix.os == 'windows-latest'
37+
name: Setup install dependencies
38+
run: |
39+
cd mamba
40+
python -m venv venv
41+
venv\Scripts\activate
42+
pip install -e .[dev,docs]
43+
- name: prep for persist
44+
run: tar -czf mamba.tar.gz mamba
45+
- name: persist
46+
uses: actions/upload-artifact@v3
47+
with:
48+
name: setup-artifact-${{ matrix.os }}-py${{ matrix.python-version }}
49+
path: mamba.tar.gz
50+
retention-days: 1
51+
linting:
52+
runs-on: ubuntu-20.04
53+
steps:
54+
- uses: actions/checkout@v3
55+
- uses: psf/black@stable
56+
with:
57+
options: '--check --target-version py311'
58+
version: '23.9.1'
59+
src: "neo3/ examples/ tests/"
60+
type-checking:
61+
needs: setup
62+
runs-on: ubuntu-20.04
63+
steps:
64+
- name: restore artifact
65+
uses: actions/download-artifact@v3
66+
with:
67+
name: setup-artifact-ubuntu-20.04-py3.11
68+
- name: Set up Python 3.11
69+
uses: actions/[email protected]
70+
with:
71+
python-version: "3.11"
72+
check-latest: true
73+
- name: extract & type check
74+
run: |
75+
tar -xf mamba.tar.gz
76+
cd mamba
77+
source venv/bin/activate
78+
make type
79+
unit-tests:
80+
name: Unit tests ${{ matrix.os }} Python ${{ matrix.python-version }}
81+
needs: setup
82+
runs-on: ${{ matrix.os }}
83+
strategy:
84+
matrix:
85+
os: [ ubuntu-20.04, windows-latest ]
86+
python-version: ["3.11", "3.12"]
87+
steps:
88+
- name: restore artifact
89+
uses: actions/download-artifact@v3
90+
with:
91+
name: setup-artifact-${{ matrix.os }}-py${{ matrix.python-version }}
92+
- name: Set up Python ${{ matrix.python-version }}
93+
uses: actions/[email protected]
94+
with:
95+
python-version: '${{ matrix.python-version }}'
96+
check-latest: true
97+
- if: success() && matrix.os == 'ubuntu-20.04'
98+
name: extract and test
99+
run: |
100+
tar -xf mamba.tar.gz
101+
cd mamba
102+
source venv/bin/activate
103+
make test
104+
- if: success() && matrix.os == 'windows-latest'
105+
name: extract and test
106+
run: |
107+
tar -xf mamba.tar.gz
108+
cd mamba
109+
venv\Scripts\activate
110+
make test
111+
coverage:
112+
needs: setup
113+
runs-on: ubuntu-20.04
114+
env:
115+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116+
steps:
117+
- name: restore artifact
118+
uses: actions/download-artifact@v3
119+
with:
120+
name: setup-artifact-ubuntu-20.04-py3.11
121+
- name: Set up Python 3.11
122+
uses: actions/[email protected]
123+
with:
124+
python-version: "3.11"
125+
check-latest: true
126+
- name: check coverage
127+
run: |
128+
tar -xf mamba.tar.gz
129+
cd mamba
130+
source venv/bin/activate
131+
coverage run -m unittest discover -v -s tests/
132+
pip install coveralls
133+
coveralls --service=github

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.coverage
2+
.idea/
3+
.vscode/
4+
.mypy_cache/
5+
dist/
6+
docs/site
7+
build/
8+
htmlcov/
9+
neo_mamba.egg-info/
10+
*__pycache__*
11+
venv/

LICENSE.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2019-present COZ
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do 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.

MANIFEST.in

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
include CHANGELOG.rst
2+
include LICENSE.md
3+
include Makefile
4+
include README.rst
5+
include setup.cfg
6+
graft examples/*
7+
graft docs/*
8+
include docs/make.bat
9+
include docs/Makefile
10+
recursive-exclude docs/build/*
11+
include neo3/py.typed
12+
graft neo3/*
13+
graft tests/*
14+
global-exclude *.py[cod]

Makefile

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
.PHONY: black build clean clean-test clean-pyc clean-build clean-docs docs docs-deploy help test coverage version-major version-minor version-patch
2+
.DEFAULT_GOAL := help
3+
define BROWSER_PYSCRIPT
4+
import os, webbrowser, sys
5+
try:
6+
from urllib import pathname2url
7+
except:
8+
from urllib.request import pathname2url
9+
10+
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
11+
endef
12+
export BROWSER_PYSCRIPT
13+
14+
define PRINT_HELP_PYSCRIPT
15+
import re, sys
16+
17+
for line in sys.stdin:
18+
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
19+
if match:
20+
target, help = match.groups()
21+
print("%-20s %s" % (target, help))
22+
endef
23+
export PRINT_HELP_PYSCRIPT
24+
BROWSER := python3 -c "$$BROWSER_PYSCRIPT"
25+
26+
help:
27+
@python3 -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
28+
29+
clean: clean-build clean-pyc clean-test clean-docs ## remove all build, test, coverage and Python artifacts
30+
31+
32+
clean-build: ## remove build artifacts
33+
rm -rf build/
34+
rm -rf dist/
35+
rm -rf .eggs/
36+
find . -name '*.egg-info' -exec rm -fr {} +
37+
find . -name '*.egg' -exec rm -f {} +
38+
39+
clean-docs: ## clean the /docs/
40+
rm -rf docs/site/
41+
42+
clean-pyc: ## remove Python file artifacts
43+
find . -name '*.pyc' -exec rm -f {} +
44+
find . -name '*.pyo' -exec rm -f {} +
45+
find . -name '*~' -exec rm -f {} +
46+
find . -name '__pycache__' -exec rm -fr {} +
47+
48+
clean-test: ## remove test and coverage artifacts
49+
rm -f .coverage
50+
rm -rf htmlcov/
51+
52+
test: ## run tests quickly with the default Python
53+
python -m unittest discover -v -s tests/
54+
55+
coverage: ## check code coverage quickly with the default Python
56+
coverage run -m unittest discover -v -s tests/
57+
coverage report
58+
coverage html
59+
$(BROWSER) htmlcov/index.html
60+
61+
docs: ## generate Sphinx HTML documentation, including API docs
62+
rm -rf docs/site/
63+
mkdocs build -f docs/mkdocs.yml
64+
$(BROWSER) docs/site/index.html
65+
66+
docs-deploy: ## manually deploy the docs to github pages
67+
aws s3 sync ./docs/site s3://docs-coz/neo3/mamba --acl public-read
68+
69+
type: ## perform static type checking using mypy
70+
mypy neo3/
71+
72+
black: ## apply black formatting
73+
black neo3/ examples/ tests/
74+
75+
build: ## create source distribution and wheel
76+
python -m build
77+
78+
version-major: ## bump the major version prior to release, auto commits and tag
79+
bump-my-version bump major
80+
81+
version-minor: ## bump the minor version prior to release, auto commits and tag
82+
bump-my-version bump minor
83+
84+
version-patch: ## bump the patch version prior to release, auto commits and tag
85+
bump-my-version bump patch

README.rst

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
# EpicChain Python SDK
3+
4+
## Introduction
5+
The EpicChain Python SDK is a software development kit that provides tools and libraries for interacting with the EpicChain blockchain network using the Python programming language. It simplifies the process of integrating EpicChain functionality into Python applications, allowing developers to build decentralized applications (DApps) and interact with the blockchain.
6+
7+
## Key Features
8+
- **Blockchain Interaction:** The SDK enables Python applications to interact with the EpicChain blockchain, including querying blockchain data, submitting transactions, and managing wallet functionality.
9+
- **Smart Contract Support:** Developers can deploy and interact with smart contracts on the EpicChain network using the SDK, facilitating the development of decentralized applications.
10+
- **Scalability:** Built-in features and optimizations ensure that the SDK can handle a high volume of transactions, making it suitable for scalable applications.
11+
- **Security:** The SDK incorporates security best practices to protect against common vulnerabilities and ensure the integrity of interactions with the EpicChain network.
12+
- **Ease of Use:** With a user-friendly interface and comprehensive documentation, the SDK makes it easy for developers to get started with EpicChain blockchain integration in their Python projects.
13+
14+
## Getting Started
15+
To start using the EpicChain Python SDK, follow these steps:
16+
17+
1. **Install the SDK:** Install the SDK using `pip` or your preferred package manager.
18+
2. **Initialize the SDK:** Set up your Python environment and initialize the SDK with your EpicChain node's endpoint.
19+
3. **Interact with the Blockchain:** Use the SDK's functions and methods to interact with the EpicChain blockchain, such as querying blockchain data or deploying smart contracts.
20+
4. **Integrate with Your Application:** Incorporate the SDK into your Python application to leverage EpicChain's features and capabilities.
21+
22+
## Usage
23+
Once the SDK is integrated into your Python application, you can use it to:
24+
25+
- **Query Blockchain Data:** Retrieve information from the EpicChain blockchain, such as transaction details or smart contract state.
26+
- **Submit Transactions:** Send transactions to the EpicChain network, including transfers of tokens or interactions with smart contracts.
27+
- **Deploy Smart Contracts:** Deploy smart contracts to the EpicChain network and interact with them using Python code.
28+
- **Manage Wallets:** Use the SDK to manage wallets and keys for secure access to the EpicChain network.
29+
30+
## Contributing
31+
Contributions to the EpicChain Python SDK are welcome. To contribute, please follow our [contribution guidelines](CONTRIBUTING.md) and submit a pull request with your changes.
32+
33+
## Support
34+
If you have any questions or need assistance with the EpicChain Python SDK, please reach out to us:
35+
36+
- **Email:** [email protected]
37+
- **Community Forum:** [EpicChain Forum](https://forum.epicchain.com)
38+
- **Telegram:** [EpicChain Telegram](https://t.me/epicchain)
39+
40+
## License
41+
The EpicChain Python SDK is released under the [MIT License](LICENSE).
42+

0 commit comments

Comments
 (0)