data-manipulation 0.48__tar.gz → 0.50__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data_manipulation-0.50/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- data_manipulation-0.50/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data_manipulation-0.50/.gitignore +99 -0
- data_manipulation-0.50/CODE_OF_CONDUCT.md +76 -0
- data_manipulation-0.50/CONTRIBUTING.md +19 -0
- data_manipulation-0.50/Makefile +144 -0
- data_manipulation-0.50/PKG-INFO +84 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/README.md +1 -1
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/__init__.py +8 -2
- data_manipulation-0.50/data_manipulation/_version.py +24 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/sqlalchemy_.py +9 -8
- data_manipulation-0.50/data_manipulation.egg-info/PKG-INFO +84 -0
- data_manipulation-0.50/data_manipulation.egg-info/SOURCES.txt +98 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation.egg-info/requires.txt +0 -1
- data_manipulation-0.50/docs/.nojekyll +0 -0
- data_manipulation-0.50/docs/Makefile +153 -0
- data_manipulation-0.50/docs/_build/doctrees/commands.doctree +0 -0
- data_manipulation-0.50/docs/_build/doctrees/data_manipulation.doctree +0 -0
- data_manipulation-0.50/docs/_build/doctrees/environment.pickle +0 -0
- data_manipulation-0.50/docs/_build/doctrees/getting-started.doctree +0 -0
- data_manipulation-0.50/docs/_build/doctrees/index.doctree +0 -0
- data_manipulation-0.50/docs/_build/doctrees/modules.doctree +0 -0
- data_manipulation-0.50/docs/_build/html/.buildinfo +4 -0
- data_manipulation-0.50/docs/_build/html/.nojekyll +0 -0
- data_manipulation-0.50/docs/_build/html/_modules/data_manipulation/base.html +576 -0
- data_manipulation-0.50/docs/_build/html/_modules/data_manipulation/beautifulsoup_.html +184 -0
- data_manipulation-0.50/docs/_build/html/_modules/data_manipulation/boto3_.html +268 -0
- data_manipulation-0.50/docs/_build/html/_modules/data_manipulation/cryptography_.html +225 -0
- data_manipulation-0.50/docs/_build/html/_modules/data_manipulation/django_.html +258 -0
- data_manipulation-0.50/docs/_build/html/_modules/data_manipulation/geopandas_.html +159 -0
- data_manipulation-0.50/docs/_build/html/_modules/data_manipulation/kerberos_.html +170 -0
- data_manipulation-0.50/docs/_build/html/_modules/data_manipulation/mysql_connector_python_.html +310 -0
- data_manipulation-0.50/docs/_build/html/_modules/data_manipulation/openldap_.html +172 -0
- data_manipulation-0.50/docs/_build/html/_modules/data_manipulation/pandas_.html +867 -0
- data_manipulation-0.50/docs/_build/html/_modules/data_manipulation/pyspark_.html +551 -0
- data_manipulation-0.50/docs/_build/html/_modules/data_manipulation/smtplib_.html +163 -0
- data_manipulation-0.50/docs/_build/html/_modules/data_manipulation/sqlalchemy_.html +274 -0
- data_manipulation-0.50/docs/_build/html/_modules/index.html +89 -0
- data_manipulation-0.50/docs/_build/html/_sources/commands.rst.txt +10 -0
- data_manipulation-0.50/docs/_build/html/_sources/data_manipulation.rst.txt +141 -0
- data_manipulation-0.50/docs/_build/html/_sources/getting-started.rst.txt +6 -0
- data_manipulation-0.50/docs/_build/html/_sources/index.rst.txt +28 -0
- data_manipulation-0.50/docs/_build/html/_sources/modules.rst.txt +7 -0
- data_manipulation-0.50/docs/_build/html/_static/basic.css +906 -0
- data_manipulation-0.50/docs/_build/html/_static/doctools.js +149 -0
- data_manipulation-0.50/docs/_build/html/_static/documentation_options.js +13 -0
- data_manipulation-0.50/docs/_build/html/_static/file.png +0 -0
- data_manipulation-0.50/docs/_build/html/_static/language_data.js +192 -0
- data_manipulation-0.50/docs/_build/html/_static/minus.png +0 -0
- data_manipulation-0.50/docs/_build/html/_static/nature.css +245 -0
- data_manipulation-0.50/docs/_build/html/_static/plus.png +0 -0
- data_manipulation-0.50/docs/_build/html/_static/pygments.css +75 -0
- data_manipulation-0.50/docs/_build/html/_static/searchtools.js +635 -0
- data_manipulation-0.50/docs/_build/html/_static/sphinx_highlight.js +154 -0
- data_manipulation-0.50/docs/_build/html/commands.html +128 -0
- data_manipulation-0.50/docs/_build/html/data_manipulation.html +2299 -0
- data_manipulation-0.50/docs/_build/html/genindex.html +509 -0
- data_manipulation-0.50/docs/_build/html/getting-started.html +113 -0
- data_manipulation-0.50/docs/_build/html/index.html +155 -0
- data_manipulation-0.50/docs/_build/html/modules.html +206 -0
- data_manipulation-0.50/docs/_build/html/objects.inv +0 -0
- data_manipulation-0.50/docs/_build/html/py-modindex.html +171 -0
- data_manipulation-0.50/docs/_build/html/search.html +98 -0
- data_manipulation-0.50/docs/_build/html/searchindex.js +1 -0
- data_manipulation-0.50/docs/commands.rst +10 -0
- data_manipulation-0.50/docs/conf.py +273 -0
- data_manipulation-0.50/docs/data_manipulation.rst +141 -0
- data_manipulation-0.50/docs/getting-started.rst +6 -0
- data_manipulation-0.50/docs/index.html +1 -0
- data_manipulation-0.50/docs/index.rst +28 -0
- data_manipulation-0.50/docs/make.bat +190 -0
- data_manipulation-0.50/docs/modules.rst +7 -0
- data_manipulation-0.50/models/.gitkeep +0 -0
- data_manipulation-0.50/notebooks/.gitkeep +0 -0
- data_manipulation-0.50/pyproject.toml +55 -0
- data_manipulation-0.50/references/.gitkeep +0 -0
- data_manipulation-0.50/reports/.gitkeep +0 -0
- data_manipulation-0.50/reports/figures/.gitkeep +0 -0
- data_manipulation-0.50/setup.cfg +4 -0
- data_manipulation-0.50/setup.sh +34 -0
- data_manipulation-0.50/test_environment.py +26 -0
- data_manipulation-0.50/tox.ini +3 -0
- data_manipulation-0.48/MANIFEST.in +0 -2
- data_manipulation-0.48/PKG-INFO +0 -41
- data_manipulation-0.48/data_manipulation/_version.py +0 -21
- data_manipulation-0.48/data_manipulation.egg-info/PKG-INFO +0 -41
- data_manipulation-0.48/data_manipulation.egg-info/SOURCES.txt +0 -29
- data_manipulation-0.48/setup.cfg +0 -12
- data_manipulation-0.48/setup.py +0 -59
- data_manipulation-0.48/versioneer.py +0 -2189
- {data_manipulation-0.48 → data_manipulation-0.50}/LICENSE +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/base.py +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/beautifulsoup_.py +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/boto3_.py +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/cryptography_.py +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/django_.py +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/flask_.py +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/geopandas_.py +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/kerberos_.py +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/mysql_connector_python_.py +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/openldap_.py +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/pandas_.py +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/postgres_.py +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/prometheus_.py +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/pyspark_.py +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation/smtplib_.py +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation.egg-info/dependency_links.txt +0 -0
- {data_manipulation-0.48 → data_manipulation-0.50}/data_manipulation.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the behavior:
|
|
15
|
+
1. Go to '...'
|
|
16
|
+
2. Click on '....'
|
|
17
|
+
3. Scroll down to '....'
|
|
18
|
+
4. See error
|
|
19
|
+
|
|
20
|
+
**Expected behavior**
|
|
21
|
+
A clear and concise description of what you expected to happen.
|
|
22
|
+
|
|
23
|
+
**Screenshots**
|
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
|
25
|
+
|
|
26
|
+
**Desktop (please complete the following information):**
|
|
27
|
+
- OS: [e.g. iOS]
|
|
28
|
+
- Browser [e.g. chrome, safari]
|
|
29
|
+
- Version [e.g. 22]
|
|
30
|
+
|
|
31
|
+
**Smartphone (please complete the following information):**
|
|
32
|
+
- Device: [e.g. iPhone6]
|
|
33
|
+
- OS: [e.g. iOS8.1]
|
|
34
|
+
- Browser [e.g. stock browser, safari]
|
|
35
|
+
- Version [e.g. 22]
|
|
36
|
+
|
|
37
|
+
**Additional context**
|
|
38
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
|
|
5
|
+
# C extensions
|
|
6
|
+
*.so
|
|
7
|
+
|
|
8
|
+
# Distribution / packaging
|
|
9
|
+
.Python
|
|
10
|
+
env/
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
*.egg-info/
|
|
23
|
+
data_manipulation/_version.py
|
|
24
|
+
.installed.cfg
|
|
25
|
+
*.egg
|
|
26
|
+
|
|
27
|
+
# PyInstaller
|
|
28
|
+
# Usually these files are written by a python script from a template
|
|
29
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
30
|
+
*.manifest
|
|
31
|
+
*.spec
|
|
32
|
+
|
|
33
|
+
# Installer logs
|
|
34
|
+
pip-log.txt
|
|
35
|
+
pip-delete-this-directory.txt
|
|
36
|
+
|
|
37
|
+
# Unit test / coverage reports
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
.coverage
|
|
41
|
+
.coverage.*
|
|
42
|
+
.cache
|
|
43
|
+
nosetests.xml
|
|
44
|
+
coverage.xml
|
|
45
|
+
*.cover
|
|
46
|
+
|
|
47
|
+
# Translations
|
|
48
|
+
*.mo
|
|
49
|
+
*.pot
|
|
50
|
+
|
|
51
|
+
# Django stuff:
|
|
52
|
+
*.log
|
|
53
|
+
|
|
54
|
+
# Sphinx documentation
|
|
55
|
+
# docs/_build/
|
|
56
|
+
!docs/build
|
|
57
|
+
|
|
58
|
+
# PyBuilder
|
|
59
|
+
target/
|
|
60
|
+
|
|
61
|
+
# DotEnv configuration
|
|
62
|
+
.env
|
|
63
|
+
|
|
64
|
+
# Database
|
|
65
|
+
*.db
|
|
66
|
+
*.rdb
|
|
67
|
+
|
|
68
|
+
# Pycharm
|
|
69
|
+
.idea
|
|
70
|
+
|
|
71
|
+
# VS Code
|
|
72
|
+
.vscode/
|
|
73
|
+
|
|
74
|
+
# Spyder
|
|
75
|
+
.spyproject/
|
|
76
|
+
|
|
77
|
+
# Jupyter NB Checkpoints
|
|
78
|
+
.ipynb_checkpoints/
|
|
79
|
+
|
|
80
|
+
# exclude data from source control by default
|
|
81
|
+
/data/
|
|
82
|
+
*.csv
|
|
83
|
+
*.xlsx
|
|
84
|
+
|
|
85
|
+
# Mac OS-specific storage files
|
|
86
|
+
.DS_Store
|
|
87
|
+
|
|
88
|
+
# vim
|
|
89
|
+
*.swp
|
|
90
|
+
*.swo
|
|
91
|
+
|
|
92
|
+
# Mypy cache
|
|
93
|
+
.mypy_cache/
|
|
94
|
+
|
|
95
|
+
# custom
|
|
96
|
+
build.sh
|
|
97
|
+
install_packages.sh
|
|
98
|
+
docs/README*
|
|
99
|
+
.opencode
|
|
@@ -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 Shawn.coding.acc@gmail.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
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Contributing to data manipulation
|
|
2
|
+
|
|
3
|
+
Whether you are a novice or experienced software developer, all contributions and suggestions are welcome!
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
If you are looking to contribute to the *data manipulation* codebase, the best place to start is the [GitHub "issues" tab](https://github.com/shawnngtq/data-manipulation/issues). This is also a great place for filing bug reports and making suggestions for ways in which we can improve the code and documentation.
|
|
8
|
+
|
|
9
|
+
## Filing Issues
|
|
10
|
+
|
|
11
|
+
If you notice a bug in the code or documentation, or have suggestions for how we can improve either, feel free to create an issue on the [GitHub "issues" tab](https://github.com/shawnngtq/data-manipulation/issues) using [GitHub's "issue" form](https://github.com/shawnngtq/data-manipulation/issues/new). The form contains some questions that will help us best address your issue.
|
|
12
|
+
|
|
13
|
+
## Contributing to the Codebase
|
|
14
|
+
|
|
15
|
+
The code is hosted on [GitHub](https://github.com/shawnngtq/data-manipulation), so you will need to use [Git](https://git-scm.com/) to clone the project and make changes to the codebase. Once you have obtained a copy of the code, you should create a development environment that is separate from your existing Python environment so that you can make and test changes without compromising your own work environment.
|
|
16
|
+
|
|
17
|
+
Before submitting your changes for review, make sure to check that your changes do not break any tests.
|
|
18
|
+
|
|
19
|
+
Once your changes are ready to be submitted, make sure to push your changes to GitHub before creating a pull request. We will review your changes, and you will most likely be asked to make additional changes before it is finally ready to merge. However, once it's ready, we will merge it, and you will have successfully contributed to the codebase!
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
.PHONY: clean data lint requirements sync_data_to_s3 sync_data_from_s3
|
|
2
|
+
|
|
3
|
+
#################################################################################
|
|
4
|
+
# GLOBALS #
|
|
5
|
+
#################################################################################
|
|
6
|
+
|
|
7
|
+
PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
|
8
|
+
BUCKET = [OPTIONAL] your-bucket-for-syncing-data (do not include 's3://')
|
|
9
|
+
PROFILE = default
|
|
10
|
+
PROJECT_NAME = data_manipulation
|
|
11
|
+
PYTHON_INTERPRETER = python3
|
|
12
|
+
|
|
13
|
+
ifeq (,$(shell which conda))
|
|
14
|
+
HAS_CONDA=False
|
|
15
|
+
else
|
|
16
|
+
HAS_CONDA=True
|
|
17
|
+
endif
|
|
18
|
+
|
|
19
|
+
#################################################################################
|
|
20
|
+
# COMMANDS #
|
|
21
|
+
#################################################################################
|
|
22
|
+
|
|
23
|
+
## Install Python Dependencies
|
|
24
|
+
requirements: test_environment
|
|
25
|
+
$(PYTHON_INTERPRETER) -m pip install -U pip setuptools wheel
|
|
26
|
+
$(PYTHON_INTERPRETER) -m pip install -r requirements.txt
|
|
27
|
+
|
|
28
|
+
## Make Dataset
|
|
29
|
+
data: requirements
|
|
30
|
+
$(PYTHON_INTERPRETER) data_manipulation/data/make_dataset.py data/raw data/processed
|
|
31
|
+
|
|
32
|
+
## Delete all compiled Python files
|
|
33
|
+
clean:
|
|
34
|
+
find . -type f -name "*.py[co]" -delete
|
|
35
|
+
find . -type d -name "__pycache__" -delete
|
|
36
|
+
|
|
37
|
+
## Lint using flake8
|
|
38
|
+
lint:
|
|
39
|
+
flake8 data_manipulation
|
|
40
|
+
|
|
41
|
+
## Upload Data to S3
|
|
42
|
+
sync_data_to_s3:
|
|
43
|
+
ifeq (default,$(PROFILE))
|
|
44
|
+
aws s3 sync data/ s3://$(BUCKET)/data/
|
|
45
|
+
else
|
|
46
|
+
aws s3 sync data/ s3://$(BUCKET)/data/ --profile $(PROFILE)
|
|
47
|
+
endif
|
|
48
|
+
|
|
49
|
+
## Download Data from S3
|
|
50
|
+
sync_data_from_s3:
|
|
51
|
+
ifeq (default,$(PROFILE))
|
|
52
|
+
aws s3 sync s3://$(BUCKET)/data/ data/
|
|
53
|
+
else
|
|
54
|
+
aws s3 sync s3://$(BUCKET)/data/ data/ --profile $(PROFILE)
|
|
55
|
+
endif
|
|
56
|
+
|
|
57
|
+
## Set up python interpreter environment
|
|
58
|
+
create_environment:
|
|
59
|
+
ifeq (True,$(HAS_CONDA))
|
|
60
|
+
@echo ">>> Detected conda, creating conda environment."
|
|
61
|
+
ifeq (3,$(findstring 3,$(PYTHON_INTERPRETER)))
|
|
62
|
+
conda create --name $(PROJECT_NAME) python=3
|
|
63
|
+
else
|
|
64
|
+
conda create --name $(PROJECT_NAME) python=2.7
|
|
65
|
+
endif
|
|
66
|
+
@echo ">>> New conda env created. Activate with:\nsource activate $(PROJECT_NAME)"
|
|
67
|
+
else
|
|
68
|
+
$(PYTHON_INTERPRETER) -m pip install -q virtualenv virtualenvwrapper
|
|
69
|
+
@echo ">>> Installing virtualenvwrapper if not already installed.\nMake sure the following lines are in shell startup file\n\
|
|
70
|
+
export WORKON_HOME=$$HOME/.virtualenvs\nexport PROJECT_HOME=$$HOME/Devel\nsource /usr/local/bin/virtualenvwrapper.sh\n"
|
|
71
|
+
@bash -c "source `which virtualenvwrapper.sh`;mkvirtualenv $(PROJECT_NAME) --python=$(PYTHON_INTERPRETER)"
|
|
72
|
+
@echo ">>> New virtualenv created. Activate with:\nworkon $(PROJECT_NAME)"
|
|
73
|
+
endif
|
|
74
|
+
|
|
75
|
+
## Test python environment is setup correctly
|
|
76
|
+
test_environment:
|
|
77
|
+
$(PYTHON_INTERPRETER) test_environment.py
|
|
78
|
+
|
|
79
|
+
#################################################################################
|
|
80
|
+
# PROJECT RULES #
|
|
81
|
+
#################################################################################
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
#################################################################################
|
|
86
|
+
# Self Documenting Commands #
|
|
87
|
+
#################################################################################
|
|
88
|
+
|
|
89
|
+
.DEFAULT_GOAL := help
|
|
90
|
+
|
|
91
|
+
# Inspired by <http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html>
|
|
92
|
+
# sed script explained:
|
|
93
|
+
# /^##/:
|
|
94
|
+
# * save line in hold space
|
|
95
|
+
# * purge line
|
|
96
|
+
# * Loop:
|
|
97
|
+
# * append newline + line to hold space
|
|
98
|
+
# * go to next line
|
|
99
|
+
# * if line starts with doc comment, strip comment character off and loop
|
|
100
|
+
# * remove target prerequisites
|
|
101
|
+
# * append hold space (+ newline) to line
|
|
102
|
+
# * replace newline plus comments by `---`
|
|
103
|
+
# * print line
|
|
104
|
+
# Separate expressions are necessary because labels cannot be delimited by
|
|
105
|
+
# semicolon; see <http://stackoverflow.com/a/11799865/1968>
|
|
106
|
+
.PHONY: help
|
|
107
|
+
help:
|
|
108
|
+
@echo "$$(tput bold)Available rules:$$(tput sgr0)"
|
|
109
|
+
@echo
|
|
110
|
+
@sed -n -e "/^## / { \
|
|
111
|
+
h; \
|
|
112
|
+
s/.*//; \
|
|
113
|
+
:doc" \
|
|
114
|
+
-e "H; \
|
|
115
|
+
n; \
|
|
116
|
+
s/^## //; \
|
|
117
|
+
t doc" \
|
|
118
|
+
-e "s/:.*//; \
|
|
119
|
+
G; \
|
|
120
|
+
s/\\n## /---/; \
|
|
121
|
+
s/\\n/ /g; \
|
|
122
|
+
p; \
|
|
123
|
+
}" ${MAKEFILE_LIST} \
|
|
124
|
+
| LC_ALL='C' sort --ignore-case \
|
|
125
|
+
| awk -F '---' \
|
|
126
|
+
-v ncol=$$(tput cols) \
|
|
127
|
+
-v indent=19 \
|
|
128
|
+
-v col_on="$$(tput setaf 6)" \
|
|
129
|
+
-v col_off="$$(tput sgr0)" \
|
|
130
|
+
'{ \
|
|
131
|
+
printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
|
|
132
|
+
n = split($$2, words, " "); \
|
|
133
|
+
line_length = ncol - indent; \
|
|
134
|
+
for (i = 1; i <= n; i++) { \
|
|
135
|
+
line_length -= length(words[i]) + 1; \
|
|
136
|
+
if (line_length <= 0) { \
|
|
137
|
+
line_length = ncol - indent - length(words[i]) - 1; \
|
|
138
|
+
printf "\n%*s ", -indent, " "; \
|
|
139
|
+
} \
|
|
140
|
+
printf "%s ", words[i]; \
|
|
141
|
+
} \
|
|
142
|
+
printf "\n"; \
|
|
143
|
+
}' \
|
|
144
|
+
| more $(shell test $(shell uname) = Darwin && echo '--no-init --raw-control-chars')
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: data_manipulation
|
|
3
|
+
Version: 0.50
|
|
4
|
+
Summary: Powerful data manipulation
|
|
5
|
+
Author-email: Shawn Ng <shawn.coding.acc@gmail.com>
|
|
6
|
+
License-Expression: BSD-3-Clause
|
|
7
|
+
Project-URL: Homepage, https://github.com/shawnngtq/data-manipulation
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: Programming Language :: Python
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Cython
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering
|
|
19
|
+
Requires-Python: >=3.9
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: beautifulsoup4
|
|
23
|
+
Requires-Dist: boto3
|
|
24
|
+
Requires-Dist: cryptography
|
|
25
|
+
Requires-Dist: django
|
|
26
|
+
Requires-Dist: flask
|
|
27
|
+
Requires-Dist: geopandas
|
|
28
|
+
Requires-Dist: ipython
|
|
29
|
+
Requires-Dist: loguru
|
|
30
|
+
Requires-Dist: mysql-connector-python
|
|
31
|
+
Requires-Dist: numpy
|
|
32
|
+
Requires-Dist: pandas
|
|
33
|
+
Requires-Dist: psycopg
|
|
34
|
+
Requires-Dist: pyspark
|
|
35
|
+
Requires-Dist: python-dotenv
|
|
36
|
+
Requires-Dist: sqlalchemy
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
|
|
39
|
+
# Data Manipulation
|
|
40
|
+
|
|
41
|
+
- [Data Manipulation](#data-manipulation)
|
|
42
|
+
- [What is it?](#what-is-it)
|
|
43
|
+
- [Where to get it](#where-to-get-it)
|
|
44
|
+
- [Dependencies](#dependencies)
|
|
45
|
+
- [License](#license)
|
|
46
|
+
- [Getting Help](#getting-help)
|
|
47
|
+
- [Discussion and Development](#discussion-and-development)
|
|
48
|
+
- [Contributing to data manipulation](#contributing-to-data-manipulation)
|
|
49
|
+
|
|
50
|
+
My data manipulation library includes functions build on top of popular Python libraries such as Pandas, PySpark and more.
|
|
51
|
+
|
|
52
|
+
## What is it?
|
|
53
|
+
|
|
54
|
+
Data Manipulation is a Python package providing powerful utility functions. It contains many subpackages with utility functions built for popular packages such as Pandas, PySpark and many more.
|
|
55
|
+
|
|
56
|
+
## Where to get it
|
|
57
|
+
|
|
58
|
+
The source code is currently hosted on GitHub at: https://github.com/shawnngtq/data-manipulation
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install data-manipulation
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Dependencies
|
|
65
|
+
|
|
66
|
+
The dependencies will be installed automatically along with this package, using metadata in `pyproject.toml`.
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
[BSD 3](LICENSE)
|
|
71
|
+
|
|
72
|
+
## Getting Help
|
|
73
|
+
|
|
74
|
+
For usage questions, the best place to go to is StackOverflow.
|
|
75
|
+
|
|
76
|
+
## Discussion and Development
|
|
77
|
+
|
|
78
|
+
Most development discussion is taking place on github in this repo.
|
|
79
|
+
|
|
80
|
+
## Contributing to data manipulation
|
|
81
|
+
|
|
82
|
+
All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome.
|
|
83
|
+
|
|
84
|
+
As contributors and maintainers to this project, you are expected to abide by our code of conduct. More information can be found at: [Contributor Code of Conduct](https://github.com/shawnngtq/data-manipulation/blob/master/CODE_OF_CONDUCT.md)
|
|
@@ -25,7 +25,7 @@ pip install data-manipulation
|
|
|
25
25
|
|
|
26
26
|
## Dependencies
|
|
27
27
|
|
|
28
|
-
The dependencies will be installed automatically along with this package, in `
|
|
28
|
+
The dependencies will be installed automatically along with this package, using metadata in `pyproject.toml`.
|
|
29
29
|
|
|
30
30
|
## License
|
|
31
31
|
|
|
@@ -17,6 +17,12 @@ from data_manipulation import (
|
|
|
17
17
|
sqlalchemy_,
|
|
18
18
|
)
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
try:
|
|
21
|
+
from ._version import __version__
|
|
22
|
+
except ImportError:
|
|
23
|
+
try:
|
|
24
|
+
from importlib.metadata import version
|
|
21
25
|
|
|
22
|
-
__version__ =
|
|
26
|
+
__version__ = version("data_manipulation")
|
|
27
|
+
except Exception:
|
|
28
|
+
__version__ = "0.0.0"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '0.50'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 50)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = 'g3a0e189a0'
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
from typing import Any, Dict, Optional
|
|
2
|
+
|
|
1
3
|
import sqlalchemy
|
|
2
|
-
from
|
|
4
|
+
from loguru import logger
|
|
3
5
|
from sqlalchemy.engine.base import Engine
|
|
6
|
+
from sqlalchemy.engine.url import URL
|
|
4
7
|
from sqlalchemy.exc import SQLAlchemyError
|
|
5
|
-
from typing import Optional, Dict, Any
|
|
6
|
-
from loguru import logger
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class DatabaseConnectionError(Exception):
|
|
@@ -27,7 +28,7 @@ def create_sqlalchemy_url(
|
|
|
27
28
|
drivername (str): Database driver name. Supported options include:
|
|
28
29
|
- 'mysql+mysqlconnector'
|
|
29
30
|
- 'mysql+pymysql'
|
|
30
|
-
- 'postgresql+
|
|
31
|
+
- 'postgresql+psycopg'
|
|
31
32
|
- 'mssql+pyodbc'
|
|
32
33
|
- 'oracle+cx_oracle'
|
|
33
34
|
- 'sqlite3'
|
|
@@ -44,7 +45,7 @@ def create_sqlalchemy_url(
|
|
|
44
45
|
|
|
45
46
|
Examples:
|
|
46
47
|
>>> url = create_sqlalchemy_url(
|
|
47
|
-
... drivername='postgresql+
|
|
48
|
+
... drivername='postgresql+psycopg',
|
|
48
49
|
... host='localhost',
|
|
49
50
|
... dbname='mydb',
|
|
50
51
|
... user='admin',
|
|
@@ -52,7 +53,7 @@ def create_sqlalchemy_url(
|
|
|
52
53
|
... port=5432
|
|
53
54
|
... )
|
|
54
55
|
>>> str(url)
|
|
55
|
-
'postgresql+
|
|
56
|
+
'postgresql+psycopg://admin:secret@localhost:5432/mydb'
|
|
56
57
|
"""
|
|
57
58
|
return URL.create(
|
|
58
59
|
drivername=drivername,
|
|
@@ -84,7 +85,7 @@ def create_sqlalchemy_engine(
|
|
|
84
85
|
drivername (str): Database driver name. Supported options include:
|
|
85
86
|
- 'mysql+mysqlconnector'
|
|
86
87
|
- 'mysql+pymysql'
|
|
87
|
-
- 'postgresql+
|
|
88
|
+
- 'postgresql+psycopg'
|
|
88
89
|
- 'mssql+pyodbc'
|
|
89
90
|
- 'oracle+cx_oracle'
|
|
90
91
|
- 'sqlite3'
|
|
@@ -107,7 +108,7 @@ def create_sqlalchemy_engine(
|
|
|
107
108
|
|
|
108
109
|
Examples:
|
|
109
110
|
>>> engine = create_sqlalchemy_engine(
|
|
110
|
-
... drivername='postgresql+
|
|
111
|
+
... drivername='postgresql+psycopg',
|
|
111
112
|
... host='localhost',
|
|
112
113
|
... dbname='mydb',
|
|
113
114
|
... user='admin',
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: data_manipulation
|
|
3
|
+
Version: 0.50
|
|
4
|
+
Summary: Powerful data manipulation
|
|
5
|
+
Author-email: Shawn Ng <shawn.coding.acc@gmail.com>
|
|
6
|
+
License-Expression: BSD-3-Clause
|
|
7
|
+
Project-URL: Homepage, https://github.com/shawnngtq/data-manipulation
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: Programming Language :: Python
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Cython
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering
|
|
19
|
+
Requires-Python: >=3.9
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: beautifulsoup4
|
|
23
|
+
Requires-Dist: boto3
|
|
24
|
+
Requires-Dist: cryptography
|
|
25
|
+
Requires-Dist: django
|
|
26
|
+
Requires-Dist: flask
|
|
27
|
+
Requires-Dist: geopandas
|
|
28
|
+
Requires-Dist: ipython
|
|
29
|
+
Requires-Dist: loguru
|
|
30
|
+
Requires-Dist: mysql-connector-python
|
|
31
|
+
Requires-Dist: numpy
|
|
32
|
+
Requires-Dist: pandas
|
|
33
|
+
Requires-Dist: psycopg
|
|
34
|
+
Requires-Dist: pyspark
|
|
35
|
+
Requires-Dist: python-dotenv
|
|
36
|
+
Requires-Dist: sqlalchemy
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
|
|
39
|
+
# Data Manipulation
|
|
40
|
+
|
|
41
|
+
- [Data Manipulation](#data-manipulation)
|
|
42
|
+
- [What is it?](#what-is-it)
|
|
43
|
+
- [Where to get it](#where-to-get-it)
|
|
44
|
+
- [Dependencies](#dependencies)
|
|
45
|
+
- [License](#license)
|
|
46
|
+
- [Getting Help](#getting-help)
|
|
47
|
+
- [Discussion and Development](#discussion-and-development)
|
|
48
|
+
- [Contributing to data manipulation](#contributing-to-data-manipulation)
|
|
49
|
+
|
|
50
|
+
My data manipulation library includes functions build on top of popular Python libraries such as Pandas, PySpark and more.
|
|
51
|
+
|
|
52
|
+
## What is it?
|
|
53
|
+
|
|
54
|
+
Data Manipulation is a Python package providing powerful utility functions. It contains many subpackages with utility functions built for popular packages such as Pandas, PySpark and many more.
|
|
55
|
+
|
|
56
|
+
## Where to get it
|
|
57
|
+
|
|
58
|
+
The source code is currently hosted on GitHub at: https://github.com/shawnngtq/data-manipulation
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install data-manipulation
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Dependencies
|
|
65
|
+
|
|
66
|
+
The dependencies will be installed automatically along with this package, using metadata in `pyproject.toml`.
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
[BSD 3](LICENSE)
|
|
71
|
+
|
|
72
|
+
## Getting Help
|
|
73
|
+
|
|
74
|
+
For usage questions, the best place to go to is StackOverflow.
|
|
75
|
+
|
|
76
|
+
## Discussion and Development
|
|
77
|
+
|
|
78
|
+
Most development discussion is taking place on github in this repo.
|
|
79
|
+
|
|
80
|
+
## Contributing to data manipulation
|
|
81
|
+
|
|
82
|
+
All contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas are welcome.
|
|
83
|
+
|
|
84
|
+
As contributors and maintainers to this project, you are expected to abide by our code of conduct. More information can be found at: [Contributor Code of Conduct](https://github.com/shawnngtq/data-manipulation/blob/master/CODE_OF_CONDUCT.md)
|