package
stringlengths 1
122
| pacakge-description
stringlengths 0
1.3M
|
---|---|
anoncreds
|
AnoncredsA Python wrapper around theanoncredsRust library, this module provides support for Hyperledger Anoncreds verifiable credential issuance, presentation, and verification.CreditThe initial implementation ofanoncreds/indy-shared-rswas developed by the Verifiable Organizations Network (VON) team based at the Province of British Columbia, and derives largely from the implementations withinHyperledger Indy-SDK. To learn more about VON and what's happening with decentralized identity in British Columbia, please go tohttps://vonx.io.ContributingPull requests are welcome! Please read ourcontributions guideand submit your PRs. We enforcedeveloper certificate of origin(DCO) commit signing. See guidancehere.We also welcome issues submitted about problems you encounter in usinganoncreds.LicenseApache License Version 2.0
|
anonfaces
|
anonfaces: Video anonymization by face detectionanonfacesis a simple command-line tool for automatic anonymization of faces in videos or photos.
It works by first detecting all human faces in each video frame and then applying an anonymization filter (blurring or black boxes) on each detected face region.
All audio tracks are discarded as well.Original frameanonfacesoutput (using default options)Installationanonfacessupports all commonly used operating systems (Linux, Windows, MacOS), but it requires using a command-line shell such as bash. There are currently no plans of creating a graphical user interface.The recommended way of installinganonfacesis via thepippackage manager. This requires that you have Python 3.6 or later installed on your system. It is recommended to set up and activate a newvirtual environmentfirst. Then you can install the latest release ofanonfacesand all necessary dependencies by running:$ python3 -m pip install anonfacesAlternatively, if you want to use the latest (unreleased) revision directly from GitHub, you can run:$ python3 -m pip install 'git+https://github.com/StealUrKill/anonfaces'This will only install the dependencies that are strictly required for running the tool. If you want to speed up processing by enabling hardware acceleration, you will need to manually install additional packages, seeHardware accelerationUsageQuick startIf you want to try out anonymizing a video using the default settings, you just need to supply the path to it. For example, if the path to your test video ismyvideos/vid1.mp4, run:$ anonfaces myvideos/vid1.mp4This will write the the output to the new video filemyvideos/vid1_anonymized.mp4.Live capture demoIf you have a camera (webcam) attached to your computer, you can runanonfaceson the live video input by calling it with thecamargument instead of an input path:$ anonfaces camThis is a shortcut for$ anonfaces --preview '<video0>', where'<video0>'(literal) is a camera device identifier. If you have multiple cameras installed, you can try'<videoN>', whereNis the index of the camera (seeimageio-ffmpeg docs).CLI usage and options summaryTo get an overview of usage and available options, run:$ anonfaces -hThe output may vary depending on your installed version, but it should look similar to this:usage: anonfaces [--output O] [--thresh T] [--scale WxH] [--preview] [--boxes]
[--draw-scores] [--mask-scale M]
[--replacewith {blur,solid,none,img}] [--replaceimg REPLACEIMG]
[--ffmpeg-config FFMPEG_CONFIG] [--backend {auto,onnxrt,opencv}]
[--version] [--help]
[input ...]
Video anonymization by face detection
positional arguments:
input File path(s) or camera device name. It is possible to
pass multiple paths by separating them by spaces or by
using shell expansion (e.g. `$ anonfaces vids/*.mp4`).
Alternatively, you can pass a directory as an input,
in which case all files in the directory will be used
as inputs. If a camera is installed, a live webcam
demo can be started by running `$ anonfaces cam` (which
is a shortcut for `$ anonfaces -p '<video0>'`.
optional arguments:
--output O, -o O Output file name. Defaults to input path + postfix
"_anonymized".
--thresh T, -t T Detection threshold (tune this to trade off between
false positive and false negative rate). Default: 0.2.
--scale WxH, -s WxH Downscale images for network inference to this size
(format: WxH, example: --scale 640x360).
--preview, -p Enable live preview GUI (can decrease performance).
--boxes Use boxes instead of ellipse masks.
--draw-scores Draw detection scores onto outputs.
--mask-scale M Scale factor for face masks, to make sure that masks
cover the complete face. Default: 1.3.
--replacewith {blur,solid,none,img}
Anonymization filter mode for face regions. "blur"
applies a strong gaussian blurring, "solid" draws a
solid black box, "none" does leaves the input
unchanged and "img" replaces the face with a custom
image. Default: "blur".
--replaceimg REPLACEIMG
Anonymization image for face regions. Requires
--replacewith img option.
--ffmpeg-config FFMPEG_CONFIG
FFMPEG config arguments for encoding output videos.
This argument is expected in JSON notation. For a list
of possible options, refer to the ffmpeg-imageio docs.
Default: '{"codec": "libx264"}'.
--backend {auto,onnxrt,opencv}
Backend for ONNX model execution. Default: "auto"
(prefer onnxrt if available).
--version Print version number and exit.
--help, -h Show this help message and exit.Usage examplesIn most use cases the default configuration should be sufficient, but depending on individual requirements and type of media to be processed, some of the options might need to be adjusted. In this section, some common example scenarios that require option changes are presented. All of the examples use the photoexamples/city.jpg, but they work the same on any video or photo file.Drawing black boxesBy default, each detected face is anonymized by applying a blur filter to an ellipse region that covers the face. If you prefer to anonymize faces by drawing black boxes on top of them, you can achieve this through the--boxesand--replacewithoptions:$ anonfaces examples/city.jpg --boxes --replacewith solid -o examples/city_anonymized_boxes.jpgTuning detection thresholdsThe detection threshold (--thresh,-t) is used to define how confident the detector needs to be for classifying some region as a face. By default this is set to the value 0.2, which was found to work well on many test videos.If you are experiencing too many false positives (i.e. anonymization filters applied at non-face regions) on your own video data, consider increasing the threshold.
On the other hand, if there are too many false negative errors (visible faces that are not anonymized), lowering the threshold is advisable.The optimal value can depend on many factors such as video quality, lighting conditions and prevalence of partial occlusions. To optimize this value, you can set threshold to a very low value and then draw detection score overlays, as described in thesection below.To demonstrate the effects of a threshold that is set too low or too high, see the examples outputs below:--thresh 0.02(notice the false positives, e.g. at hand regions)--thresh 0.7(notice the false negatives, especially at partially occluded faces)Drawing detection score overlaysIf you are interested in seeing the faceness score (a score between 0 and 1 that roughly corresponds to the detector's confidence that somethingisa face) of each detected face in the input, you can enable the--draw-scoresoption to draw the score of each detection directly above its location.$ anonfaces examples/city.jpg --draw-scores -o examples/city_anonymized_scores.jpgThis option can be useful to figure out an optimal value for the detection threshold that can then be set through the--threshoption.High-resolution media and performance issuesSinceanonfacestries to detect faces in the unscaled full-res version of input files by default, this can lead to performance issues on high-res inputs (>> 720p). In extreme cases, even detection accuracy can suffer because the detector neural network has not been trained on ultra-high-res images.To counter these performance issues,anonfacessupports downsampling its inputs on-the-fly before detecting faces, and subsequently rescaling detection results to the original resolution. Downsampling only applies to the detection process, whereas the final output resolution remains the same as the input resolution.This feature is controlled through the--scaleoption, which expects a value of the formWxH, whereWandHare the desired width and height of downscaled input representations.
It is very important to make sure the aspect ratio of the inputs remains intact when using this option, because otherwise, distorted images are fed into the detector, resulting in decreased accuracy.For example, if your inputs have the common aspect ratio 16:9, you can instruct the detector to run in 360p resolution by specifying--scale 640x360.
If the results at this fairly low resolution are not good enough, detection at 720p input resolution (--scale 1280x720) may work better.Hardware accelerationDepending on your available hardware, you can often speed up neural network inference by enabling the optionalONNX Runtimebackend ofanonfaces.CUDA (on Nvidia GPUs)If you have a CUDA-capable GPU, you can enable GPU acceleration by installing the relevant packages:$ python3 -m pip install onnx onnxruntime-gpuIf theonnxruntime-gpupackage is found and a GPU is available, the face detection network is automatically offloaded to the GPU.
This can significantly improve the overall processing speed.Other platformsIf your machine doesn't have a CUDA-capable GPU but you want to accelerate computation on another hardware platform (e.g. Intel CPUs), you can look into the available options in theONNX Runtime build matrix.How it worksThe included face detection system is based on CenterFace (code,paper), a deep neural network optimized for fast but reliable detection of human faces in photos.
The network was trained on theWIDER FACEdataset, which contains annotated photos showing faces in a wide variety of scales, poses and occlusions.Although the face detector is originally intended to be used for normal 2D images,anonfacescan also use it to detect faces in video data by analyzing each video frame independently.
The face bounding boxes predicted by the CenterFace detector are then used as masks to determine where to apply anonymization filters.Creditscenterface.onnx(original) andcenterface.py(modified) are based onhttps://github.com/Star-Clouds/centerface(revision8c39a49),released under MIT license.The original source of the example images in theexamplesdirectory can be foundhere(released under thePexels photo license).
|
anonfile
|
Anonfiles.com Unofficial Python APIThis unofficial Python API was created to make uploading and downloading files
fromhttps://anonfiles.comsimple and effective for programming in Python. The goal of
the project is to create an intuitive library for anonymous file sharing.Getting StartedThese instructions will get you a copy of the project up and running on your local
machine for development and testing purposes. See deployment for notes on how to
deploy the project on a live system.PrerequisitesPython 3.8+ is required to run this application, other than that there are no
prerequisites for the project, as the dependencies are included in the repository.InstallingTo install the library is as simple as runningpipinstallanonfilefrom the command line. To install this library in debug mode with dev dependencies, usepipinstall-e.[dev]instead. It is recommended to create an virtual environment prior
to installing this library. If you only intend to use this library from the CLI,
usepipxfor the installation instead:pipxinstallanonfileDev NotesRun unit tests locally:pytest--verbose-s[--token"REDACTED"]Add the-k test_*option if you want to test only a single function.UsageImport the module and instantiate theAnonFile()constructor. Setting the download
directory inpathis optional. Using the APItokenin the constructor is optional
as well. A validtokenregisters all file uploads online, i.e. a list of all uploaded
files is made accessible to any user thatsigns into your account.fromanonfileimportAnonFileanon=AnonFile()# upload a file and enable progressbar terminal feedback (off by default)upload=anon.upload('/home/guest/jims_paperwork.doc',progressbar=True)print(upload.url.geturl())# download a file and set the download directoryfrompathlibimportPathtarget_dir=Path.home().joinpath('Downloads')download=anon.download("https://anonfiles.com/9ee1jcu6u9/test_txt",path=target_dir)print(download.file_path)And voilà, pain-free anonymous file sharing. If you want more information about
theAnonFileAPI visitanonfiles.com.Command Line Interface# open help page for specific commandsanonfile[download|upload|preview|log]--help# note: both methods expect at least one argument, but can take on moreanonfiledownload--urlhttps://anonfiles.com/93k5x1ucu0/test_txt
anonfileupload--file./test.txtBuilt WithRequests- Http for HumansTQDM- Fast & Extensible Progress Barsanonfiles.com- AnonFiles.com REST APIVersioningNavigate totags on this repositoryto see all available versions.AuthorsNameMail AddressGitHub ProfileNicholas [email protected]@outlook.comhentai-chanStefan [email protected] also the list ofcontributorswho participated in this project.LicenseThis project is licensed under the MIT License - see theLICENSEfile for more details.AcknowledgmentsJoseph Marie JacquardCharles BabbageAda LovelaceMy DadHat tip to anyone whose code was usedInspirationetc
|
anonfiles
|
anonfiles-scriptAn upload script for anonfile.com made in python. Supports multiple files.Installationpip3installanonfilesUsageanonup{path-to-file_1}{path-to-file_2}...# upload file to anonfile serveranond{url1}{url2}...# download fileAPIThe anonfile-upload client is also usable through an API (for test integration, automation, etc)anonfiles.upload([file1, file2])fromanonfilesimportuploadupload([file1,file2])anonfiles.download([file1, file2])fromanonfilesimportdownloaddownload([file1,file2])
|
anonfiles-directlink
|
Anonfiles.com direct link generatorGenerate direct link for downloading file from anonfiles.comRequirementsAt least Python 3,beautifulsoup4, andrequestsas wellUsageimport anonfiles-directlink as d
link = 'some anonfiles link'
download_link = d.direct_link(link)
print(direct_link)
|
anonfiles-py
|
anonfiles.pySimple AnonFiles.com API Wrapper written on Python3BayFiles is also added and supported.Install$ pip3 install anonfiles-pyUsageCLIUpload files directly toAnonFiles.com. Multi-files is not supported.anonfiles [filename / path of file]IntegratefromanonfilesimportAnonFiles# BayFiles is also available and can be used similarly.# `from anonfiles import BayFiles`a=AnonFiles()up=a.upload("example.py")print(up.status)© 2021 TheBoringDude
|
anonfiles-uploader-SockYeh
|
Anonfiles-UplaoderThis is just a normal Anonfiles uploader (that works) with alot of kwel features!Source CodeSupport Me!Bitcoin address:39J66CZbPB3uTbdzbvXrBdpo75MTZVwymbEthereum address:0x649158AF89d517872C500E0494d87c7d8926B492Litecoin address:MEMVARxfVGjkWFNo8efsvhkR7fy99VWVYK
|
anonip
|
anonipDigitale Gesellschafthttps://www.digitale-gesellschaft.chFormerly
Swiss Privacy Foundationhttps://www.privacyfoundation.ch/DescriptionAnonip is a tool to anonymize IP addresses in log files.It masks the last bits of IPv4 and IPv6 addresses. That way most of the
relevant information is preserved, while the IP-address does not match a
particular individuum anymore.Depending on your webserver software, the log entries may directly get piped
to Anonip. The unmasked IP addresses will never be written to any file.Using shell redirects, it's also possible to rewrite existing log files.FeaturesMasks IP addresses in log filesConfigurable amount of masked bitsThe column containing the IP address can freely be chosenAlternatively use a regex to point anonip to the location(s) of the IP(s). Seethis RFCfor more information.Works for both access.log- and error.log filesOfficially supported python versions2.73.63.73.83.93.10DependenciesIf you're using python version >=3.3, there are no external
dependencies.For python versions <3.3:ipaddress moduleInvocationusage: anonip.py [-h] [-4 INTEGER] [-6 INTEGER] [-i INTEGER] [-o FILE]
[--input FILE] [-c INTEGER [INTEGER ...]] [-l STRING]
[--regex STRING [STRING ...]] [-r STRING] [-p] [-d] [-v]
Anonip is a tool to anonymize IP-addresses in log files.
optional arguments:
-h, --help show this help message and exit
-4 INTEGER, --ipv4mask INTEGER
truncate the last n bits (default: 12)
-6 INTEGER, --ipv6mask INTEGER
truncate the last n bits (default: 84)
-i INTEGER, --increment INTEGER
increment the IP address by n (default: 0)
-o FILE, --output FILE
file to write to
--input FILE File or FIFO to read from (default: stdin)
-c INTEGER [INTEGER ...], --column INTEGER [INTEGER ...]
assume IP address is in column n (1-based indexed;
default: 1)
-l STRING, --delimiter STRING
log delimiter (default: " ")
--regex STRING [STRING ...]
regex for detecting IP addresses (use instead of -c)
-r STRING, --replace STRING
replacement string in case address parsing fails
(Example: 0.0.0.0)
-p, --skip-private do not mask addresses in private ranges. See IANA
Special-Purpose Address Registry.
-d, --debug print debug messages
-v, --version show program's version number and exit
Example-usage in apache-config:
CustomLog "| /path/to/anonip.py [OPTIONS] --output /path/to/log" combinedUsage/path/to/anonip.py[OPTIONS]</path/to/orig_log--output/path/to/logor using shell redirects only (mind the redirected output is appending):/path/to/anonip.py[OPTIONS]</path/to/orig_log>>/path/to/logWith ApacheIn the Apache configuration (or the one of a vhost) the log output needs to
get piped to anonip like this:CustomLog "|/path/to/anonip.py [OPTIONS] --output /path/to/log" combined
ErrorLog "|/path/to/anonip.py [OPTIONS] --output /path/to/error_log"That's it! All the IP addresses will be masked in the log now.With nginxnginx does not support spawning a process it then pipes to. Thus
you need to create a named pipe (file-based FIFO) and start the
processes yourself, along this lines:mkfifo/path/to/log.fifo/path/to/error_log.fifo
/path/to/anonip.py[OPTIONS]--output/path/to/log</path/to/log.fifo&/path/to/anonip.py[OPTIONS]--output/path/to/error_log</path/to/error_log.fifo&As you can see, you need to start a separate process for each access-log
file and for each error-log file.In the nginx configuration (or the one of a vhost) the log output
needs to be set to the named pipe like this:access_log /path/to/log.fifo;
error_log /path/to/error_log.fifo;As a python moduleRead from stdin:fromanonipimportAnonipanonip=Anonip()forlineinanonip.run():print(line)Manually feed lines:fromanonipimportAnonipdata=['1.1.1.1','2.2.2.2','3.3.3.3']anonip=Anonip()forlineindata:print(anonip.process_line(line))Python 2 or 3?For compatibility reasons, anonip uses the shebang#! /usr/bin/env python.
This will default to python2 on all Linux distributions except for Arch Linux.
The performance of anonip can be improved by running it with python3. If
python3 is available on your system, you should preferrably invoke anonip
like this:python3-manonip[OPTIONS]orpython3/path/to/anonip.py[OPTIONS]MotivationIn most cases IP addresses are personal data as they refer to individuals (or at least
their Internet connection). IP addresses - and the data associated with them - may
therefore only be lawfully processed in accordance with the principles of the
applicable data protection laws.Storage of log files from web servers, for example, is only permitted within close time
limits or with the voluntary consent of the persons concerned (as long as the
information about the IP address is linkable to a person).Anonip tries to avoid exactly that, but without losing the benefit of those log files.With the masking of the last bits of IP addresses, we're still able to distinguish the
log entries up to a certain degree. Compared to the entire removal of the IP-adresses,
we're still able to make a rough geolocating as well as a reverse DNS lookup. But the
otherwise distinct IP addresses do not match a particular individuum anymore.
|
anonjail
|
Anonjailanonjail is a tool to integrateFirejail +
Torsandboxing in the Linux
desktop. Enable anonjail for an application and enjoy a more private and
more secure desktop.Those are the real coders behind this code, i’ve only made some brainless tweaks:https://github.com/orjail/orjail&https://github.com/rahiel/firectlInstallAutomatic anonjail install with pip (debian10 based distros running
GNOME only for naw. I know im so sorry):sudopip3installanonjailAnonjail self install and config dependenciesSupported distros : DebiansudoanonjailinstallInstall dependencies manuallysudoapt-get-yupdatesudoapt-get-yinstallbctorfirejailpython3-pipExtra manual steps (Enabling services and FireJail networking)sudosystemctlenabletor--nowsudosystemctlenableapparmor--nowsudosed-i's/restricted-network yes/restricted-network no/g'/etc/firejail/firejail.configIf you r running Kaligitclonehttps://github.com/annoyinganongurl/kali-firejail-profiles.gitcp-Rkali-firejail-profiles/*/etc/firejail/rm-rfkali-firejail-profilesUninstallTo uninstall anonjail:sudopip3uninstallanonjailUsageTo see which applications owning a personal FJ profile you can enable
and current config infosanonjailstatusTo see which applications with no personal FJ profile you can enableanonjailshowappsTo enable firejail for a programsudoanonjailenable[name]ex:sudoanonjailenablefirefoxTo disable firejail for a programsudoanonjaildisable[name]ex:sudoanonjaildisablefirefoxTo enable tor + firejail for all programsudoanonjailenable--all--torTo enable tor + firejail anonjail for a programsudoanonjailenable[name]--torex:sudoanonjailenablefirefox--tor
|
anonknight
|
No description available on PyPI.
|
anonlink
|
A Python (and optimised C++) implementation ofanonymous linkageusingcryptographic linkage keysas described by Rainer Schnell, Tobias
Bachteler, and Jörg Reiher inA Novel Error-Tolerant Anonymous Linking
Code.anonlinkcomputes similarity scores, and/or best guess matches between sets
ofcryptographic linkage keys(hashed entity records).Useclkhashto create cryptographic linkage keys
from personally identifiable data.InstallationInstall a precompiled wheel from PyPi:pip install anonlinkOr (if your system has a C++ compiler) you can locally install from source:pip install -r requirements.txt
pip install -e .BenchmarkYou can run the benchmark with:$ python -m anonlink.benchmark
Anonlink benchmark -- see README for explanation
------------------------------------------------
Threshold: 0.5, All results returned
Size 1 | Size 2 | Comparisons | Total Time (s) | Throughput
| | (match %) | (comparisons / matching)| (1e6 cmp/s)
-------+--------+------------------+-------------------------+-------------
1000 | 1000 | 1e6 (50.73%) | 0.762 (49.2% / 50.8%) | 2.669
2000 | 2000 | 4e6 (51.04%) | 3.696 (42.6% / 57.4%) | 2.540
3000 | 3000 | 9e6 (50.25%) | 8.121 (43.5% / 56.5%) | 2.548
4000 | 4000 | 16e6 (50.71%) | 15.560 (41.1% / 58.9%) | 2.504
Threshold: 0.5, Top 100 matches per record returned
Size 1 | Size 2 | Comparisons | Total Time (s) | Throughput
| | (match %) | (comparisons / matching)| (1e6 cmp/s)
-------+--------+------------------+-------------------------+-------------
1000 | 1000 | 1e6 ( 6.86%) | 0.170 (85.9% / 14.1%) | 6.846
2000 | 2000 | 4e6 ( 3.22%) | 0.384 (82.9% / 17.1%) | 12.561
3000 | 3000 | 9e6 ( 2.09%) | 0.612 (81.6% / 18.4%) | 18.016
4000 | 4000 | 16e6 ( 1.52%) | 0.919 (78.7% / 21.3%) | 22.135
5000 | 5000 | 25e6 ( 1.18%) | 1.163 (80.8% / 19.2%) | 26.592
6000 | 6000 | 36e6 ( 0.97%) | 1.535 (75.4% / 24.6%) | 31.113
7000 | 7000 | 49e6 ( 0.82%) | 1.791 (80.6% / 19.4%) | 33.951
8000 | 8000 | 64e6 ( 0.71%) | 2.095 (81.5% / 18.5%) | 37.466
9000 | 9000 | 81e6 ( 0.63%) | 2.766 (72.5% / 27.5%) | 40.389
10000 | 10000 | 100e6 ( 0.56%) | 2.765 (81.7% / 18.3%) | 44.277
20000 | 20000 | 400e6 ( 0.27%) | 7.062 (86.2% / 13.8%) | 65.711
Threshold: 0.7, All results returned
Size 1 | Size 2 | Comparisons | Total Time (s) | Throughput
| | (match %) | (comparisons / matching)| (1e6 cmp/s)
-------+--------+------------------+-------------------------+-------------
1000 | 1000 | 1e6 ( 0.01%) | 0.009 (99.0% / 1.0%) | 113.109
2000 | 2000 | 4e6 ( 0.01%) | 0.033 (98.7% / 1.3%) | 124.076
3000 | 3000 | 9e6 ( 0.01%) | 0.071 (99.1% / 0.9%) | 128.515
4000 | 4000 | 16e6 ( 0.01%) | 0.123 (99.0% / 1.0%) | 131.654
5000 | 5000 | 25e6 ( 0.01%) | 0.202 (99.1% / 0.9%) | 124.999
6000 | 6000 | 36e6 ( 0.01%) | 0.277 (99.0% / 1.0%) | 131.403
7000 | 7000 | 49e6 ( 0.01%) | 0.368 (98.9% / 1.1%) | 134.428
8000 | 8000 | 64e6 ( 0.01%) | 0.490 (99.0% / 1.0%) | 131.891
9000 | 9000 | 81e6 ( 0.01%) | 0.608 (99.0% / 1.0%) | 134.564
10000 | 10000 | 100e6 ( 0.01%) | 0.753 (99.0% / 1.0%) | 134.105
20000 | 20000 | 400e6 ( 0.01%) | 2.905 (98.8% / 1.2%) | 139.294
Threshold: 0.7, Top 100 matches per record returned
Size 1 | Size 2 | Comparisons | Total Time (s) | Throughput
| | (match %) | (comparisons / matching)| (1e6 cmp/s)
-------+--------+------------------+-------------------------+-------------
1000 | 1000 | 1e6 ( 0.01%) | 0.009 (99.0% / 1.0%) | 111.640
2000 | 2000 | 4e6 ( 0.01%) | 0.033 (98.6% / 1.4%) | 122.060
3000 | 3000 | 9e6 ( 0.01%) | 0.074 (99.1% / 0.9%) | 123.237
4000 | 4000 | 16e6 ( 0.01%) | 0.124 (99.0% / 1.0%) | 130.204
5000 | 5000 | 25e6 ( 0.01%) | 0.208 (99.1% / 0.9%) | 121.351
6000 | 6000 | 36e6 ( 0.01%) | 0.275 (99.0% / 1.0%) | 132.186
7000 | 7000 | 49e6 ( 0.01%) | 0.373 (99.0% / 1.0%) | 132.650
8000 | 8000 | 64e6 ( 0.01%) | 0.496 (99.1% / 0.9%) | 130.125
9000 | 9000 | 81e6 ( 0.01%) | 0.614 (99.0% / 1.0%) | 133.216
10000 | 10000 | 100e6 ( 0.01%) | 0.775 (99.1% / 0.9%) | 130.230
20000 | 20000 | 400e6 ( 0.01%) | 2.939 (98.9% / 1.1%) | 137.574The tables are interpreted as follows. Each table measures the throughput
of the Dice coefficient comparison function. The four tables correspond to
two different choices of “matching threshold” and “result limiting”.These parameters have been chosen to characterise two different performance
scenarios. Since the data used for comparisons is randomly generated, the
first threshold value (0.5) will cause about 50% of the candidates to
“match”, while the second threshold value (0.7) will cause ~0.01% of the
candidates to match (these values are reported in the “match %” column).
Where the table heading includes “All results returned”, all matches above
the threshold are returned and passed to the solver.
With the threshold of0.5, the large number of matches means that much
of the time is spent keeping the candidates in order. Next we limit the
number of matches per record to the top 100 - which also must be above the
threshold.In the final two tables we use the threshold value of0.7, this very
effectively filters the number of candidate matches down. Here the throughput
is determined primarily by the comparison code itself, adding the top 100
filter has no major impact.Finally, the Total Time column includes indications as to the
proportion of time spent calculating the (sparse) similarity matrixcomparisonsand the proportion of time spentmatchingin the
greedy solver. This latter is determined by the size of the similarity
matrix, which will be approximately#comparisons * match% / 100.TestsRun unit tests withpytest:$ pytest
====================================== test session starts ======================================
platform linux -- Python 3.6.4, pytest-3.2.5, py-1.4.34, pluggy-0.4.0
rootdir: /home/hlaw/src/n1-anonlink, inifile:
collected 71 items
tests/test_benchmark.py ...
tests/test_bloommatcher.py ..............
tests/test_e2e.py .............ss....
tests/test_matcher.py ..x.....x......x....x..
tests/test_similarity.py .........
tests/test_util.py ...
======================== 65 passed, 2 skipped, 4 xfailed in 4.01 seconds ========================To enable slightly larger tests add the following environment variables:INCLUDE_10KINCLUDE_100KLimitationsThe linkage process has order n^2 time complexity - although algorithms exist to
significantly speed this up. Several possible speedups are described
inPrivacy Preserving Record Linkage with PPJoin.DiscussionIf you run into bugs, you can file them in ourissue trackeron GitHub.There is also ananonlink mailing listfor development discussion and release announcements.Wherever we interact, we strive to follow thePython Community Code of Conduct.CitingAnonlink is designed, developed and supported byCSIRO’s Data61. If you use any part
of this library in your research, please cite it using the following BibTex entry:@misc{Anonlink,
author = {CSIRO's Data61},
title = {Anonlink Private Record Linkage System},
year = {2017},
publisher = {GitHub},
journal = {GitHub Repository},
howpublished = {\url{https://github.com/data61/anonlink}},
}LicenseCopyright 2017 CSIRO (Data61)Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
|
anonlink-client
|
Anonlink ClientClient-facing API to interact with anonlink system including command line tools and Rest API communication.
Anonlink system needs the following three components to work together:clkhashblocklibThis package provides an easy-to-use API to interact with the above packages to complete a record linkage job.The way to interact with anonlink system is via Command Line Toolanonlink. You can encode data containing PI (Personal
Identifying Information) locally usinganonlink encodeand generate candidate blocks locally to scale up record linkage
usinganonlink block.InstallationInstall with pip/poetry etc.:pipinstallanonlink-clientDocumentationhttps://anonlink-client.readthedocs.io/en/stable/CLI ToolAfter installation, you should have aanonlinkprogram in your path. For
example, to encode PII dataalice.csvlocally with schemaschema.jsonand secrethorse, run:$anonlinkencode'alice.csv''horse''schema.json''encoded-entities.json'It will generate the CLK output and store inclk.json. To find out how to define the schema
for your PII data, please referthis pagefor
details.
|
anonLLM
|
anonLLM: Anonymize Personally Identifiable Information (PII) for Large Language Model APIsanonLLM is a Python package designed to anonymize personally identifiable information (PII) in text data before it's sent to Language Model APIs like GPT-3. The goal is to protect user privacy by ensuring that sensitive data such as names, email addresses, and phone numbers are anonymized.FeaturesAnonymize names
Anonymize email addresses
Anonymize phone numbers
Support for multiple country-specific phone number formats
Reversible anonymization (de-anonymization)
InstallationTo install anonLLM, run:pipinstallanonLLMQuick StartHere's how to get started with anonLLM:fromanonLLM.llmimportOpenaiLanguageModelfromdotenvimportload_dotenvload_dotenv()# Anonymize a texttext="Write a CV for me: My name is Alice Johnson, "\"email: [email protected], phone: +1 234-567-8910."\"I am a machine learning engineer."# Anonymization is handled under the hoodllm=OpenaiLanguageModel()response=llm.generate(text)print(response)In this example, the response will contain the correct name provided.
At the same time, no PII will be sent to OpenAI.ContributingWe welcome contributions!LicenseThis project is licensed under the MIT License.
|
anonmail
|
No description available on PyPI.
|
anonomatic-client
|
Anonomatic ClientSimple client to interact with the Anonomatic API.Changelog0.0.2Fix package creation to actually include code0.0.1Initial creationRemove extraneous PDBs
|
anonphoto
|
No description available on PyPI.
|
anonpi
|
anonpi: Python Module for Calling SystemsTheanonpimodule is a powerful Python package that provides a convenient interface for interacting with calling systems. It simplifies the development of applications that require functionalities such as machine detection, IVR (Interactive Voice Response), DTMF (Dual-Tone Multi-Frequency) handling, recording, playback, and more.Key FeaturesMachine Detection:Easily detect whether a call is being answered by a human or an automated system, enabling intelligent call handling and routing.IVR Support:Build interactive voice response systems by creating menus, prompts, and collecting user input through voice or DTMF tones.DTMF Handling:Efficiently capture and process DTMF tones (telephone keypad input) during calls for user interaction, menu navigation, and decision-making.Call Recording:Seamlessly record incoming or outgoing calls, enabling compliance with legal requirements, quality monitoring, and archiving for later analysis.Playback Functionality:Retrieve and play back pre-recorded audio files during calls, enhancing the user experience and providing personalized content.Call Control:Take control of call initiation, termination, and manipulation, allowing for call transfers, forwarding, muting, and more.UsageTheanonpimodule provides a clean and intuitive API, making it easy to integrate calling functionalities into your Python applications. Here's an example of how you can use the module to perform machine detection during a call:importanonpianonpi.api_key="<API KEY>call=anonpi.Call.create(from_number="18888888888",to_number="1234567890",callback_url="https://callback.url",amd=False)# operations using callcall.gather_using_audio(audio_url="https://audio.url",dtmf_digits="6")# last hangup the callcall.hangup()Getting StartedTo install the anonpi module, use the following command:pipinstallanonpiAdd any additional installation instructions or requirements here.Disclaimer: Ensure compliance with all legal and regulatory requirements when using the "anonpi" module for call recording or related functionalities.Additional ResourcesDocumentation LinkGitHub Repository
|
anonpy
|
AnonPyAboutTheanonpymodule makes it easier to communicate with REST APIs for anonymously
uploading and downloading files. It implements an extensible provider-independent
class system and also comes with an intuitive CLI or lightweight GUI for interactive
usage.Documentation for this project is located on the GitHubWikipage.Installationanonpyis available on PyPI:pipinstallanonpyRelease candidates (preview versions) of this library can be installed with:pipinstall-ihttps://test.pypi.org/simple/anonpyTo ensure a clean and isolated environment for runninganonpy's CLI, it is
recommended to install it with thepipxcommand.pipxinstallanonpyLibraryanonpycan be used to interface with a wide variety of REST services by
building a contract with theEndpointclass.fromanonpyimportAnonPy,Endpointapi="https://pixeldrain.com/api/"endpoint=Endpoint(upload="/file",download="file/{}",preview="/file/{}/info")anon=AnonPy(api,endpoint)# retrieve resource meta data without committing to a downloadpreview=anon.preview("LNcXZ9UM")print(f"{preview=}")# download a resource to the current working directorydownload=anon.download("LNcXZ9UM",progressbar=True)print(f"{download=}")# upload a fileupload=anon.upload("homework.docx",progressbar=True)print(f"{upload=}")Command Line InterfaceRead the help manual:anonpy--helpGraphical User Interface⚠ This feature is currently not implemented yet, but is expected to be released
in version 1.2.0Launch a graphical user interface for uploading and downloading files:anonpy--guiAcknowledgementsHistorically speaking, this module can be considered a continuation of theanonfile-apiproject, although
any resemblance of compatibility may only be temporary. On 16 August 2023, the
anonymous file sharing websitehttps://anonfiles.comshut down due to overwhelming
abuse by the community, which was the driving factor for creating a backend-agnostic
library that can stand the test of time. That's why to this day,anonpystill
uses the anonfiles logo as a small nod to its past.Special thanks to@aaronlyyfor passing on the
PyPI [email protected] also the list ofcontributorswho participated in the development of this project.Further ReadingThis Project is licensed under theMITlicense.
Check out theContributing Guidelinesto learn more about how you can help this project grow.
Navigate to theDiscussionspanel to ask questions or make feature requests.
|
anon.py
|
No description available on PyPI.
|
anon-requests
|
No description available on PyPI.
|
anon-sdk
|
Anon SDK
|
anonshort
|
UNKNOWN
|
anon-testo
|
No description available on PyPI.
|
anonupload
|
anonfiles-scriptAn upload script for anonfiles.com made in python. Supports multiple files.FeaturesProgress barupload urls will save in a file.You can change file name before upload on anonfile serverInstallationpip3installanonuploadUsageanonup{path-to-file_1}{path-to-file_2}...# upload file to anonfile serveranond{url1}{url2}...# and upload directly to anonfilesAPIThe anonfile-upload client is also usable through an API (for test integration, automation, etc)anonupload.upload(filename)fromanonuploadimportuploadupload(filename)fromanonuploadimportchangefile_and_uploadchangefile_and_upload([file1,file2])anonupload.download(url)fromanonuploadimportdownloaddownload(url)anonupload.downloads([url1, url2])fromanonuploadimportdownloadsdownloads([url1,url2])
|
anonx
|
AnonymousA python library with tools.Installation$ pip install anonymousLicenseDistributed under theGPL-3.0license. SeeLICENSEfor more information.
|
anony
|
AnonymousA python library with tools.Installation$ pip install anonymousLicenseDistributed under theGPL-3.0license. SeeLICENSEfor more information.
|
anonym
|
anonymTheanonymlibrary is designed to anonymize sensitive data in Python, allowing users to work with, share, or publish their data without compromising privacy or violating data protection regulations. It uses Named Entity Recognition (NER) fromspacyto identify sensitive information in the data. Once identified, the library leverages thefakerlibrary to generate fake but realistic replacements. Depending on the type of sensitive information (like names, addresses, dates), corresponding faker methods are used, ensuring the anonymized data maintains a similar structure and format to the original, making it suitable for further data analysis or testing.Theanonymalgorithm is designed to anonymize data in a DataFrame. It works by replacing real data with fake data, while maintaining the structure and format of the original data. Here's a step-by-step explanation of how it works:1. Initialization: The anonym class is initialized with a language parameter (default is 'dutch') and a verbosity level (default is 'info'). The language parameter is used to load the appropriate language model for named entity recognition (NER), and the verbosity level sets the logger's verbosity.2. Data Import: The import_data method is used to import a dataset from a given file path. The data is read into a pandas DataFrame.3. Data Anonymization: The anonymize method is the core of the algorithm. It takes a DataFrame and optional parameters for specifying columns to fake or not to fake, and a NER blacklist. The method works as follows:4. It calls the extract_entities functionto extract all entities from the DataFrame. This function uses thespacylibrary's NER capabilities to identify entities in the data. If a column is specified in the fakeit parameter, the entities in that column are replaced with the specified fake replacement. If a column is specified in the do_not_fake parameter, it is left untouched. Otherwise, NER is performed on each row of the column.5. The generate_fake_labels functionis then called to generate fake labels for the extracted entities. This function uses thefakerlibrary to generate fake data that matches the type of the original data (e.g., names, companies, dates, cities, etc.).6. The replace_label_with_fake functionis then used to replace the original entities in the DataFrame with the generated fake labels.7. Data Export: The to_csv method is used to write the anonymized DataFrame to a CSV file.8. Example Data Import: The import_example method is used to import example datasets from a GitHub source or a specified URL.Start
|
v
Initialize `anonym` class
|
v
Import data using `import_data` method
|
v
Anonymize data using `anonymize` method
| |
| v
| Extract entities using `extract_entities` function
| |
| v
| Generate fake labels using `generate_fake_labels` function
| |
| v
| Replace original labels with fake ones using `replace_label_with_fake` function
v
Export anonymized data using `to_csv` method
|
v
EndThe algorithm also includes several utility functions for text cleaning, preprocessing, filtering values, checking thespacymodel, and setting the logger. The main function at the end of the script demonstrates how to use the anonym class to import an example dataset, anonymize it, and plot the results.Documentationanonym documentation pages (Sphinx)ContentsInstallationContributeCitationMaintainersLicenseInstallationInstall anonym from PyPI (recommended). anonym is compatible with Python 3.6+ and runs on Linux, MacOS X and Windows.A new environment can be created as following:condacreate-nenv_anonympython=3.10
condaactivateenv_anonympipinstallanonym# normal installpipinstall--upgradeanonym# or update if neededAlternatively, you can install from the GitHub source:# Directly install from github sourcepipinstall-egit://gitlab.com/datainnovatielab/public/[email protected]#egg=master
pipinstallgit+https://gitlab.com/datainnovatielab/public/anonym#egg=master
pipinstallgit+https://gitlab.com/datainnovatielab/public/anonym# By cloninggitclonehttps://gitlab.com/datainnovatielab/public/anonym.gitcdanonym
pipinstall-U.Import anonym packageimportanonymasanonymExample:# Example 2# Load libraryfromanonymimportanonym# Initializemodel=anonym(language='english',verbose='info')# Import example data setdf=model.import_example('titanic')# Anonimyze the data setdf_fake=model.anonymize(df)Referenceshttps://gitlab.com/datainnovatielab/public/anonymCitationPlease cite in your publications if this is useful for your research (see citation).ContributeAll kinds of contributions are welcome!LicenceSeeLICENSEfor details.
|
anonymeter
|
Anonymeter: Unified Framework for Quantifying Privacy Risk in Synthetic DataAnonymeteris a unified statistical framework to jointly quantify different
types of privacy risks in synthetic tabular datasets.Anonymeteris equipped
with attack-based evaluations for theSingling Out,Linkability, andInferencerisks, which are the three key indicators of factual anonymization
according to theArticle 29 Working Party.Anonymeter has been positively reviewed by the technical experts from theCommission Nationale de l’Informatique et des Libertés (CNIL)which, in their words,“have not identified any reason suggesting that the proposed set of methods could not allow to effectively evaluate the extent to which the aforementioned three criteria are fulfilled or not in the context of production and use of synthetic datasets”. The CNIL also expressed the opinion that the results of Anonymeter (i.e. the three risk scores)should be used by the data controller to decide whether the residual risks of re-identification are acceptable or not, and whether the dataset could be considered anonymous.Hereyou can find the full letter with the CNIL opinion on Anonymeter.Anonymeterin a nutshelInAnonymetereach privacy risk is derived from a privacy attacker whose task is to use the synthetic dataset
to come up with a set ofguessesof the form:"there is only one person with attributes X, Y, and Z" (singling out)"records A and B belong to the same person" (linkability)"a person with attributes X and Y also have Z" (inference)Each evaluation consists of running three different attacks:the "main" privacy attack, in which the attacker uses the synthetic data to guess information on records in the original data.the "control" privacy attack, in which the attacker uses the synthetic data to guess information on records in the control dataset.the "baseline" attack, which models a naive attacker who ignores the synthetic data and guess randomly.Checking how many of these guesses are correct, the success rates of the different attacks are measured and used to
derive an estimate of the privacy risk. In particular, the "control attack" is used to separate what the attacker
learns from theutilityof the synthetic data, and what is instead indication of privacy leaks.
The "baseline attack" instead functions as a sanity check. The "main attack" attack should outperform random
guessing in order for the results to be trusted.For more details, a throughout
description of the framework and the attack algorithms can be found in the paperA Unified Framework for Quantifying Privacy Risk in Synthetic Data, accepted at the 23rd Privacy Enhancing Technologies Symposium (PETS 2023).Setup and installationAnonymeterrequires Python 3.8.x, 3.9.x or 3.10.x installed. The simplest way to installAnonymeteris fromPyPi. Simply runpip install anonymeterand you are good to go.Local installationTo installAnonymeterlocally, clone the repository:[email protected]:statice/anonymeter.gitand install the dependencies:cdanonymeter# if you are not there alreadypipinstall.# Basic dependenciespipinstall".[notebooks]"# Dependencies to run example notebookspipinstall-e".[notebooks,dev]"# Development setupIf you experience issues with the installation, we recommend to installanonymeterin a new clean virtual environment.Getting startedCheck out the example notebook in thenotebooksfolder to start playing around
withanonymeter. To run this notebook you would needjupyterand some plotting libraries.
This should be installed as part of thenotebooksdependencies. If you haven't done so, please
install them by executing:pipinstallanonymeter[notebooks]if you are installing anonymeter fromPyPi, or:pipinstall".[notebooks]"if you have opted for a local installation.Basic usage patternFor each of the three privacy risks anonymeter provide anEvaluatorclass. The high-level classesSinglingOutEvaluator,LinkabilityEvaluator, andInferenceEvaluatorare the only thing that you need to import fromAnonymeter.Despite the different nature of the privacy risks they evaluate, these classes have the same interface and are used in the same way. To instantiate the evaluator you have to provide three dataframes: the original datasetoriwhich has been used to generate the synthetic data, the synthetic datasyn, and acontroldataset containing original records which have not been used to generate the synthetic data.Another parameter common to all evaluators is the number of target records to attack (n_attacks). A higher number will reduce the statistical uncertainties on the results, at the expense of a longer computation time.evaluator=*Evaluator(ori:pd.DataFrame,syn:pd.DataFrame,control:pd.DataFrame,n_attacks:int)Once instantiated the evaluation pipeline is executed when calling theevaluate, and the resulting estimate of the risk can be accessed using therisk()method.evaluator.evaluate()risk=evaluator.risk()Configuring loggingAnonymeteruses the standard Python logger namedanonymeter.
You can configure the logging level and the output destination
using the standard Python logging API (seeherefor more details).For example, to set the logging level toDEBUGyou can use the following snippet:importlogging# set the logging level to DEBUGlogging.getLogger("anonymeter").setLevel(logging.DEBUG)And if you want to log to a file, you can use the following snippet:importlogging# create a file handlerfile_handler=logging.FileHandler("anonymeter.log")# set the logging level for the file handlerfile_handler.setLevel(logging.DEBUG)# add the file handler to the loggerlogger=logging.getLogger("anonymeter")logger.addHandler(file_handler)logger.setLevel(logging.DEBUG)Cite this workIf you use anonymeter in your work, we would appreciate citations to the following paper:"A Unified Framework for Quantifying Privacy Risk in Synthetic Data", M. Giomiet al, PoPETS 2023.
Thisbibtexentry can be used to refer to the paper:@misc{anonymeter,
doi = {https://doi.org/10.56553/popets-2023-0055},
url = {https://petsymposium.org/popets/2023/popets-2023-0055.php},
journal = {Proceedings of Privacy Enhancing Technologies Symposium},
year = {2023},
author = {Giomi, Matteo and Boenisch, Franziska and Wehmeyer, Christoph and Tasnádi, Borbála},
title = {A Unified Framework for Quantifying Privacy Risk in Synthetic Data},
}
|
anonymiseip
|
Copyright (c) 2011, Canonical LtdThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.anonymiseip anonymises IPv4 addresses using the MaxMind GeoIP database. Source
addresses are mapped to country level, then assigned a different address from
within that pool. To avoid known address back-mapping, the source address is
hashed, and the hash taken mod pool-size to pick the new address. As IPv4
address space is very small, this is still vulnerable to brute forcing - its
feasible to generate every single mapping, and if a single mapping is found it
would be possible to cater for salted hashes as well. As such, this is not
suitable for protecting against malicious attacks, it is however suitable to
use when ensuring employees do not have casual access to the IP address from
weblogs, which count as personally identifying information, while still
giving employees access to the same logs so they can look at usage patterns
and troubleshoot slow requests etc.To anonymise an IPv4 address, perform a GET to /ipv4/x.y.z.a, the response
will be a 200 OK + the new ip address, or a 5xx error.DependenciesPython 2.6+Maxmind GeoIP Python library and a country level database.InstallationRun python -m anonymiseip.main in an environment with all the dependencies
available. Alternatively run ./bootstrap.py to create bin/buildout, then
bin/buildout to create a bin/py and finally bin/py -m gpverify.main.Note that the GeoIP Python library and database may have to be installed by
hand. On Ubuntu systems they are available in the python-geoip and
geoip-database packages respectively. Anonymiseip looks for the database in
‘/usr/share/GeoIP/GeoIP.dat’.Testinganonymiseip is stateless and fast, so just use it directly for testing.Pass –host 0.0.0.0 –port 0 will cause a port to be dynamically allocated and
printed out, which your test driver can then use.
|
anonymiser
|
# anonymisationLe répertoire anonymisation fournit une méthode, des outils et des références sur l’anonymisation des données à caractère personnel.## Objectifs et usagesCe projet a pour objectif :
+ D’introduire l’utilisateur et le producteur de données aux enjeux de l’anonymisation, d’un point de vue juridique, scientifique et technique.
+ De construire un espace collaboratif autour de ce thème.
+ De proposer une méthode robuste et testée de k-anonymisation de données.## ContenuPlus précisément, cet espace est constitué d’un wiki permettent de détailler et de comprendre l’anonymisation.
Le code formalise le traitement de k-anonymisation et, en guise de cas pratique, est notamment appliqué à la base Transparence Santé. Le détail des différentes étapes est disponible ici : [Transparence Santé](https://github.com/SGMAP-AGD/anonymisation/wiki/Transparence-Sant%C3%A9).
Un autre exemple est appliqué sur la base du fichier des équidés.## DonnéesLes données exploitées pour tester notre algorithme peuvent être téléchargées :
* [Transparence Santé](https://www.data.gouv.fr/fr/datasets/transparence-sante-1/) (data.gouv.fr)
* [Enrichissement des données](http://www.insee.fr/fr/themes/detail.asp?reg_id=99&ref_id=equip-serv-medical-para) (INSEE)
* [Fichier des équidés](https://www.data.gouv.fr/fr/datasets/fichier-des-equides/) (data.gouv.fr)## Installationpip install anonymizer## Qui sommes-nous ?
Ce projet est développé par [l’équipe de l’Administrateur Général des Données (AGD)](http://agd.data.gouv.fr/), en collaboration avec toutes les bonnes volontés et les producteurs de données à caractère personnel. [Le forum d’Etalab](https://forum.etalab.gouv.fr/) est aussi ouvert à toute question, remarque ou suggestion. [Une consultation](https://forum.etalab.gouv.fr/search?q=anonymisation) sur les logiciels d’anonymisation y a notamment été initiée.
|
anonymization
|
AnonymizationText anonymization in many languages for python3.6+ usingFaker.InstallpipinstallanonymizationExampleReplace emails and named entities in englishThis example use NamedEntitiesAnonymizer which requirespacyand a spacy model.pipinstallspacy
python-mspacydownloaden_core_web_lg>>>fromanonymizationimportAnonymization,AnonymizerChain,EmailAnonymizer,NamedEntitiesAnonymizer>>>text="Hi John,\nthanks for you for subscribing to Superprogram, feel free to ask me any question at [email protected]\nSuperprogram the best program!">>>anon=AnonymizerChain(Anonymization('en_US'))>>>anon.add_anonymizers(EmailAnonymizer,NamedEntitiesAnonymizer('en_core_web_lg'))>>>anon.anonymize(text)'Hi Holly,\nthanks for you for subscribing to Ariel, feel free to ask me any question at [email protected]\nAriel the best program!'Or make it reversible with pseudonymize:>>>fromanonymizationimportAnonymization,AnonymizerChain,EmailAnonymizer,NamedEntitiesAnonymizer>>>text="Hi John,\nthanks for you for subscribing to Superprogram, feel free to ask me any question at [email protected]\nSuperprogram the best program!">>>anon=AnonymizerChain(Anonymization('en_US'))>>>anon.add_anonymizers(EmailAnonymizer,NamedEntitiesAnonymizer('en_core_web_lg'))>>>clean_text,patch=anon.pseudonymize(text)>>>print(clean_text)'Christopher,\nthanks for you for subscribing to Audrey, feel free to ask me any question at [email protected]\nAudrey the best program!'revert_text=anon.revert(clean_text,patch)>>>print(text==revert_text)trueReplace a french phone number with a fake oneOur solution supports many languages along with their specific information formats.For example, we can generate a french phone number:>>>fromanonymizationimportAnonymization,PhoneNumberAnonymizer>>>>>>text="C'est bien le 0611223344 ton numéro ?">>>anon=Anonymization('fr_FR')>>>phoneAnonymizer=PhoneNumberAnonymizer(anon)>>>phoneAnonymizer.anonymize(text)"C'est bien le 0144939332 ton numéro ?"More examples in/examplesIncluded anonymizersFilesnamelangFilePathAnonymizer-InternetnamelangEmailAnonymizer-UriAnonymizer-MacAddressAnonymizer-Ipv4Anonymizer-Ipv6Anonymizer-Phone numbersnamelangPhoneNumberAnonymizer47+msisdnAnonymizer47+DatenamelangDateAnonymizer-OthernamelangNamedEntitiesAnonymizer7+DictionaryAnonymizer-SignatureAnonymizer7+Custom anonymizersCustom anonymizers can be easily created to fit your needs:classCustomAnonymizer():def__init__(self,anonymization:Anonymization):self.anonymization=anonymizationdefanonymize(self,text:str)->str:returnmodified_text# or replace by regex patterns in text using a faker providerreturnself.anonymization.regex_anonymizer(text,pattern,provider)# or replace all occurences using a faker providerreturnself.anonymization.replace_all(text,matchs,provider)You may also add new faker provider with the helperAnonymization.add_provider(FakerProvider)or access the faker instance directlyAnonymization.faker.BenchmarkThis module is benchmarked onsynth_datasetfrompresidio-researchand returns accuracy result(0.79) better than Microsoft's solution(0.75)You can run the benchmark using docker:dockerbuild.-f./benchmark/dockerfile-tanonbench
dockerrun-it--rm--nameanonbenchanonbenchLicenseMIT
|
anonymization-tool
|
An anonymization tool which utilises NER packages such as flair, NLTK,spaCy and stanza to mask personal names (default). Other information such as NRIC, phone number etc can also be masked by giving corresponding input.
|
anonymize
|
UNKNOWN
|
anonymizedf
|
Anonymize df: a convenient way to anonymize your data for analyticsWhat is it?Anonymize dfis a package that helps you quickly and easily generate realistic
fake data from a Pandas DataFrame.What are the expected use cases / why was this made?You're hiring consultants to work on your data but need to anonymize it firstYou're a consultant and created something great that you want to make into a templateInstallationYou can install anonymizedf using pip:pipinstallanonymizedfThis will also try downloading the tableau hyper api and pandas packages
if you don't have them already.If you don't want to use pip you can also download this repository and execute:pythonsetup.pyinstallExample usageimportpandasaspdfromanonymizedf.anonymizedfimportanonymize# Import the datadf=pd.read_csv("https://query.data.world/s/shcktxndtu3ojonm46tb5udlz7sp3e")# Prepare the data to be anonymizedan=anonymize(df)# Select what data you want to anonymize and your preferred style# Example 1 - just updates dfan.fake_names("Customer Name")an.fake_ids("Customer ID")an.fake_whole_numbers("Loyalty Reward Points")an.fake_categories("Segment")an.fake_dates("Date")an.fake_decimal_numbers("Fraction")# Example 2 - method chainingfake_df=(an.fake_names("Customer Name",chaining=True).fake_ids("Customer ID",chaining=True).fake_whole_numbers("Loyalty Reward Points",chaining=True).fake_categories("Segment",chaining=True).fake_dates("Date",chaining=True).fake_decimal_numbers("Fraction",chaining=True).show_data_frame())# Example 3 - multiple assignmentsfake_df=an.fake_names("Customer Name")fake_df=an.fake_ids("Customer ID")fake_df=an.fake_whole_numbers("Loyalty Reward Points")fake_df=an.fake_categories("Segment")fake_df=an.fake_dates("Date")fake_df=an.fake_decimal_numbers("Fraction")fake_df.to_csv("fake_customers.csv",index=False)# One thing to note is that you can't directly pass in a list of columns.# If you want to apply the same function to multiple columns there are many ways to do that.# Example 4 - for multiple columnsforcolumnincolumn_list:an.fake_categories(column)Example outputCustomer IDCustomer NameLoyalty Reward PointsSegmentDateFractionFake_Customer NameFake_Customer IDFake_Loyalty Reward PointsFake_SegmentFake_DateFake_Fraction0AA-10315Alex Avila76Consumer01/01/20007.6Christian Metcalfe-ReidYEJP71011502726136558Segment 11978-11-0929.961AA-10375Allen Armold369Consumer02/01/200036.9Helen TaylorXWOB83170110594048286Segment 11989-12-2972.502AA-10480Andrew Allen162Consumer03/01/200016.2Joanne PriceVVCJ28547588747677742Segment 11982-09-2379.773AA-10645Anna Andreadi803Consumer04/01/200080.3Rhys JonesOXCI12190813836802206Segment 12000-10-147.154AB-10015Aaron Bergman935Consumer05/01/200093.5Nigel Baldwin-CookJOXS05799252235987914Segment 12018-01-3040.66DependenciesPandasFaker
|
anonymized-fraud-detection
|
Anonymized Credit Card Fraud Detection PackageCreating this package so that I can deploy this code on pip.Next, I need to import this while deploying the code as an Airflow task.All this becausePythonVirtualenvOperator()doesn't let you access outside scripts from the virtual env.Have created modular scripts for train and test time.
|
anonymizeip
|
anonymize_ipThis is a simple Python library for anonymizing IP addresses. Both IPv4 and IPv6 addresses are supported.Examples:IPv4:95.239.169.11→95.239.169.0IPv6:5219:3a94:fdc5:19e1:70a3:b2c4:40ef:ae03→5219:3a94:fdc5:19e1::Usagepip install anonymizeipfromanonymizeipimportanonymize_ipaddress="fe80::0202:b3ff:fe1e:8329"anonymized=anonymize_ip(address)print(anonymized)# Prints "fe80::"SettingsThe number of address blocks that are set to 0 can be customized.Besides the IP address, the functionanonymize_iptakes two optional parameters:anonymize_ip(address,ipv4_mask="...",ipv6_mask="...")ipv4_mask: Defaults to255.255.255.0, i.e. the last octet will be anonymized (set to 0)ipv6_mask: Defaults toffff:ffff:ffff:ffff::(same asffff:ffff:ffff:ffff:0:0:0:0), i.e. the last four blocks will be anonymized (set to 0)Developmentgit clonepipenv install --devMake your code modificationspipenv run testpipenv run lintContributions are always welcome. Please first discuss changes via issue before submitting a pull request.CreditsThe implementation of this library was strongly inspired byphp-ip-anonymizerby Geert Wirken.
|
anonymizer
|
# anonymisationLe répertoire anonymisation fournit une méthode, des outils et des références sur l’anonymisation des données à caractère personnel.## Objectifs et usagesCe projet a pour objectif :
+ D’introduire l’utilisateur et le producteur de données aux enjeux de l’anonymisation, d’un point de vue juridique, scientifique et technique.
+ De construire un espace collaboratif autour de ce thème.
+ De proposer une méthode robuste et testée de k-anonymisation de données.## ContenuPlus précisément, cet espace est constitué d’un wiki permettent de détailler et de comprendre l’anonymisation.
Le code formalise le traitement de k-anonymisation et, en guise de cas pratique, est notamment appliqué à la base Transparence Santé. Le détail des différentes étapes est disponible ici : [Transparence Santé](https://github.com/SGMAP-AGD/anonymisation/wiki/Transparence-Sant%C3%A9).
Un autre exemple est appliqué sur la base du fichier des équidés.## DonnéesLes données exploitées pour tester notre algorithme peuvent être téléchargées :
* [Transparence Santé](https://www.data.gouv.fr/fr/datasets/transparence-sante-1/) (data.gouv.fr)
* [Enrichissement des données](http://www.insee.fr/fr/themes/detail.asp?reg_id=99&ref_id=equip-serv-medical-para) (INSEE)
* [Fichier des équidés](https://www.data.gouv.fr/fr/datasets/fichier-des-equides/) (data.gouv.fr)## Installationpip install anonymizer## Qui sommes-nous ?
Ce projet est développé par [l’équipe de l’Administrateur Général des Données (AGD)](http://agd.data.gouv.fr/), en collaboration avec toutes les bonnes volontés et les producteurs de données à caractère personnel. [Le forum d’Etalab](https://forum.etalab.gouv.fr/) est aussi ouvert à toute question, remarque ou suggestion. [Une consultation](https://forum.etalab.gouv.fr/search?q=anonymisation) sur les logiciels d’anonymisation y a notamment été initiée.
|
anonymizers
|
Anonymizers🎭 - ner, regex, flash text anonymizerThis project is a data anonymization library built with Rust 🦀.It uses three techniques to anonymize data:Named Entity Recognition (NER),Flash Text,Regular Expressions (Regex).Library can be used:python library 🐍rust library 🦀REST API 🌐Docker image 🐠AnonymizersNamed Entity Recognition (NER)This method enables the library to identify and anonymize sensitive named entities in your data, like names, organizations, locations, and other personal identifiers.Anonymizers library uses ML models in onnx format (usingtract).To prepare onnx model (they are only for converting model to onnx thus you don't need them during inference) additional libraries will be required:pipinstalltorchonnxsacremosestransformers[onnx]You can use exsting models from HuggingFace (please note that repository license is only associated with library code) egendslim/bert-base-NERplclarin-pl/FastPDNmultilanguagexlm-roberta-large-finetuned-conll03-englishimportosimporttransformersfromtransformersimportAutoModelForMaskedLM,AutoTokenizer,AutoModelForTokenClassificationfromtransformers.onnximportFeaturesManagerfrompathlibimportPathfromtransformersimportpipelinemodel_id='dslim/bert-base-NER'tokenizer=AutoTokenizer.from_pretrained(model_id)model=AutoModelForTokenClassification.from_pretrained(model_id)feature='token-classification'model_kind,model_onnx_config=FeaturesManager.check_supported_model_or_raise(model,feature=feature)onnx_config=model_onnx_config(model.config)output_dir="./dslim"os.makedirs(output_dir,exist_ok=True)# exportonnx_inputs,onnx_outputs=transformers.onnx.export(preprocessor=tokenizer,model=model,config=onnx_config,opset=13,output=Path(output_dir+"/model.onnx"))print(onnx_inputs)print(onnx_outputs)tokenizer.save_pretrained(output_dir)configuration fileconfig.yaml:pipeline:
- kind: ner
model_path: ./examples/dslim/model.onnx
tokenizer_path: ./examples/dslim/tokenizer.json
id2label:
"0": ["O", false]
"1": ["B-MISC", true]
"2": ["I-MISC", true]
"3": ["B-PER", true]
"4": ["I-PER", true]
"5": ["B-ORG", true]
"6": ["I-ORG", true]
"7": ["B-LOC", true]
"8": ["I-LOC", true]Flash TextA fast method for searching and replacing words in large datasets, used to anonymize predefined sensitive information.configuration fileconfig.yaml:pipeline:-kind:flashTextname:FRUIT_FLASHfile:./tests/config/fruits.txtkeywords:-apple-banana-plumRegexThis method provides a flexible way to identify and anonymize data patterns like credit card numbers, social security numbers, etc.configuration fileconfig.yaml:pipeline:-kind:regexname:FRUIT_REGEXfile:./tests/config/fruits_regex.txtpatterns:-\bapple\w*\b-\bbanana\w*\b-\bplum\w*\bUsageREST APIThe library exposes a simple and user-friendly REST API, making it easy to integrate this anonymization functionality into your existing systems or applications.git clone https://github.com/qooba/anonymize-rs
cd anonymize-rs
cargo run -- server --host 0.0.0.0 --port 8089 --config config.yamlwhereconfig.yaml:pipeline:-kind:flashTextname:FRUIT_FLASHfile:./tests/config/fruits.txt-kind:regexname:FRUIT_REGEXfile:./tests/config/fruits_regex.txt-kind:nermodel_path:./examples/dslim/model.onnxtokenizer_path:./examples/dslim/tokenizer.jsontoken_type_ids_included:trueid2label:"0":["O",false]# [replacement, is_to_replaced]"1":["B-MISC",true]"2":["I-MISC",true]"3":["B-PER",true]"4":["I-PER",true]"5":["B-ORG",true]"6":["I-ORG",true]"7":["B-LOC",true]"8":["I-LOC",true]Anonymizationcurl -X POST "http://localhost:8080/api/anonymize" -H "accept: application/json" -H "Content-Type: application/json" -d '{"text":"I like to eat apples and bananas and plums"}'orcurl -X GET "http://localhost:8080/api/anonymize?text=I like to eat apples and bananas and plums" -H "accept: application/json" -H "Content-Type: application/json"Response:{
"text": "I like to eat FRUIT_FLASH0 and FRUIT_FLASH1 and FRUIT_REGEX0",
"items": {
"FRUIT_FLASH0": "apples",
"FRUIT_FLASH1": "banans",
"FRUIT_REGEX0": "plums"
}
}Deanonymizationcurl -X POST "http://localhost:8080/api/deanonymize" -H "accept: application/json" -H "Content-Type: application/json" -d '{
"text": "I like to eat FRUIT_FLASH0 and FRUIT_FLASH1 and FRUIT_REGEX0",
"items": {
"FRUIT_FLASH0": "apples",
"FRUIT_FLASH1": "banans",
"FRUIT_REGEX0": "plums"
}
}'Response:{
"text": "I like to eat apples and bananas and plums"
}Docker imageYou can simply run anonymization server using docker image:docker run -it -v $(pwd)/config.yaml:config.yaml -p 8080:8080 qooba/anonymize-rs server --host 0.0.0.0 --port 8080 --config config.yamlPythonpip install anonymizers>>>fromanonymizersimportNer,Regex,FlashText>>>id2label={"0":("O",False),"1":("B-MISC",True),"2":("I-MISC",True),"3":("B-PER",True),"4":("I-PER",True),"5":("B-ORG",True),"6":("I-ORG",True),"7":("B-LOC",True),"8":("I-LOC",True)}>>>ner_anonymizer=Ner("./dslim/model.onnx","./dslim/tokenizer.json",id2label)MODELLOADED:3.25sTOKENIZERLOADED:14.10ms>>>ner_anonymizer.anonymize("My name is Sarah and I live in London. I like London.")('My name is B-PER0 and I live in B-LOC0. I like B-LOC0.',{'B-PER0':'Sarah','B-LOC0':'London'})>>>fromanonymizersimportNer,Regex,FlashText>>>flash_anonymizer=FlashText("FRUIT",None,["apple","banana","plum"])>>>flash_anonymizer.anonymize("I like to eat apples and bananas and plums.")('I like to eat FRUIT0 and FRUIT1 and FRUIT2.',{'FRUIT2':'plums','FRUIT1':'bananas','FRUIT0':'apples'})⚠️ Note: Anonymizers library can help identify sensitive/PII data in un/structured text. However, it uses automated detection mechanisms, and there is no guarantee that it will find all sensitive information. Consequently, additional systems and protections should be employed. This tool is meant to be a part of your privacy protection suite, not the entirety of it. Always ensure your data protection measures are comprehensive and multi-layered.
|
anonymize-UU
|
Anonymize UUThis description can be foundon GitHub hereAnonymize_UU facilitates the replacement of keywords or regex-patterns within a file tree or zipped archive. It recursively traverses the tree, opens supported files and substitutes any found pattern or keyword with a replacement. Besides contents, anomize_UU will substitue keywords/patterns in file/folder-paths as well.The result will be either a copied or replaced version of the original file-tree with all substitutions made.As of now, Anonymize_UU supports text-based files, like .txt, .html, .json and .csv. UTF-8 encoding is assumed. Besides text files, Anonymize_UU is also able to handle (nested) zip archives. These archives will be unpacked in a temp folder, processed and zipped again.Installation$ pip install anonymize_UUUsageImport the Anomymize class in your code and create an anonymization object like this:from anonymize import Anonymize
# refer to csv files in which keywords and substitutions are paired
anonymize_csv = Anonymize('/Users/casper/Desktop/keys.csv')
# using a dictionary instead of a csv file:
my_dict = {
'A1234': 'aaaa',
'B9876': 'bbbb',
}
anonymize_dict = Anonymize(my_dict)
# specifying a zip-format to zip unpacked archives after processing (.zip is default)
anonymize_zip = Anonymize('/Users/casper/Desktop/keys.csv', zip_format='gztar')When using a csv-file, anonymize_UU will assume your file contains two columns: the left column contains the keywords which need to be replaced, the right column contains their substitutions.Column headers are mandatory, but don't have to follow a specific format.When using a dictionary only (absence of thepatternargument), the keys will be replaced by their values.Performance might be enhanced when your keywords can be generalized into regular expressions. Anynomize_UU will search these patterns and replace them instead of matching the entire dictionary/csv-file against file contents or file/folder-paths. Example:anonymize_regex = Anonymize(my_dict, pattern=r'[A-B]\d{4}')By default is case sensitive by default. The regular expressions that take care of the replacements can be modified by using theflagparameter. It takes one or more variableswhich can be found here. Multiple variables are combined by a bitwise OR (the | operator). Example for a case-insensitive substitution:anonymize_regex = Anonymize(my_dict, flags=re.IGNORECASE)By using theuse_word_boundariesargument (defaults to False), the algorithm ignores substring matches. If 'ted' is a key in your dictionary, withoutuse_word_boundariesthe algorithm will replace the 'ted' part in f.i. 'created_at'. You can overcome this problem by settinguse_word_boundariesto True. It will put the\b-anchor around your regex pattern or dictionary keys. The beauty of the boundary anchors is that '@' is considered a boundary as well, and thus names in email addresses can be replaced. Example:anonymize_regex = Anonymize(my_dict, use_word_boundaries=True)Windows usageThere is an issue with creating zip archives. Make sure yourun anonymize_UU as administrator.Copy vs. replacingAnonymize_UU is able to create a copy of the processed file-tree or replace it. Thesubstitutemethod takes a mandatory source-path argument (path to a file, folder or zip-archive, either a string or aPathobject) and an optional target-path argument (again, a string orPathobject). The targetneeds to refer to a folder. The target-folder will be created if it doesn't exist.When the target argument is provided, anonymize_UU will create a processed copy of the source into the target-folder. When the target argument is omitted, the source will be overwritten by a processed version of it:# process the datadownload.zip file, replace all patterns and write
# a copy to the 'bucket' folder.
anonymize_regex.substitute(
'/Users/casper/Desktop/datadownload.zip',
'/Users/casper/Desktop/bucket'
)
# process the 'download' folder and replace the original by its processed
# version
anonymize_regex.substitute('/Users/casper/Desktop/download')
# process a single file, and replace it
anonymize_regex.substitute('/Users/casper/Desktop/my_file.json')TodoTesting ;)
|
anonymous
|
AnonymousA python library with tools.Installation$ pip install anonymousLicenseDistributed under theGPL-3.0license. SeeLICENSEfor more information.
|
anonymouse-lib
|
No description available on PyPI.
|
anonymous-matlab.py
|
MATLAB
|
anonymous-requests
|
No description available on PyPI.
|
anonymoususage
|
UNKNOWN
|
anonymoUUs
|
anonymoUUsThis description can be foundon GitHub hereanonymoUUs facilitates the replacement of keywords or regex-patterns within a file tree or zipped archive. It recursively traverses the tree, opens supported files and substitutes any found pattern or keyword with a replacement. Besides contents, anonymoUUs will substitue keywords/patterns in file/folder-paths as well.The result will be either a copied or replaced version of the original file-tree with all substitutions made.As of now, anonymoUUs supports text-based files, like .txt, .html, .json and .csv. UTF-8 encoding is assumed. Besides text files, anonymoUUs is also able to handle (nested) zip archives. These archives will be unpacked in a temp folder, processed and zipped again.Installation$ pip install anonymoUUsUsageIn order to replace words or patterns you need a replacement-mapping in the form of:a dictionary - the keys will be replaced by the valuesthe path to a csv file - a csv file will be converted in a dictionary, the first column provides keys, the second value provides values. Path can be a String, Path or PosixPath!a function - a replacement function can be passed if a pattern is used. The function takes a found match and should return its replacement. The function must have at least one input argument.Example of replacement with a dictionaryImport the Anomymize class in your code and create an anonymization object like this:fromanonymoUUsimportAnonymize# refer to csv files in which keywords and substitutions are pairedanonymize_csv=Anonymize('/Users/casper/Desktop/keys.csv')# using a dictionary instead of a csv file:my_dict={'A1234':'aaaa','B9876':'bbbb',}anonymize_dict=Anonymize(my_dict)Putting regular expression in dictionaries is also possible.When using a dictionary only (absence of thepatternargument), the keys-pattern will be replaced by its value:anon = Anonymize(
{
'regular-key': 'replacement-1',
re.compile('ca.*?er'): 'replacement-2'
}
)Example of replacement with a CSV file# specifying a zip-format to zip unpacked archives after processing (.zip is default)anonymize_zip=Anonymize('/Users/casper/Desktop/keys.csv')When using a csv-file, anonymoUUs will assume your file contains two columns: the left column contains the keywords which need to be replaced, the right column contains their substitutions.Column headers are mandatory, but don't have to follow a specific format.It is possible to add a regular expression as keyword in the csv-file. Make sure they start with the prefix 'r#'. Example:r#ca.*?er, replacement_stringThe key will be compiles as a regex and replace every match with 'replacement_string'.Example of replacement by regex pattern and functionIf you are replacing with a pattern you can also use a function to 'calculate' the replacement string:defreplace(match,**kwargs):result='default-replacement'match=int(match)threshold=kwargs.get("threshold",4000)ifmatch<threshold:result='special-replacement'returnresultanon=Anonymize(replace,pattern=r'\d{4}',threshold=1000)anon.substitute('/Users/casperkaandorp/Desktop/test.json','/Users/casperkaandorp/Desktop/result-folder')Note the possibility to provide additional arguments when you initialize an Anonymize object that will be passed to the replcement function (in the previous example, thethresholdis passed to thereplacefunction).Other argumentsPerformance is probably best when your keywords can be generalized into a single regular expressions. anonymoUUs will search these patterns and replace them instead of matching the entire dictionary/csv-file against file contents or file/folder-paths. Example:anonymize_regex = Anonymize(my_dict, pattern=r'[A-B]\d{4}')By default is case sensitive by default. The regular expressions that take care of the replacements can be modified by using theflagparameter. It takes one or more variableswhich can be found here. Multiple variables are combined by a bitwise OR (the | operator). Example for a case-insensitive substitution:anonymize_regex = Anonymize(my_dict, flags=re.IGNORECASE)By using theuse_word_boundariesargument (defaults to False), the algorithm ignores substring matches. If 'ted' is a key in your dictionary, withoutuse_word_boundariesthe algorithm will replace the 'ted' part in f.i. 'created_at'. You can overcome this problem by settinguse_word_boundariesto True. It will put the\b-anchor around your regex pattern or dictionary keys. The beauty of the boundary anchors is that '@' is considered a boundary as well, and thus names in email addresses can be replaced. Example:anonymize_regex = Anonymize(my_dict, use_word_boundaries=True)It is also to specify how to re-zip unzipped folders:# specifying a zip-format to zip unpacked archives after processing (.zip is default)anonymize_zip=Anonymize('/Users/casper/Desktop/keys.csv',zip_format='gztar')Windows usageThere is an issue with creating zip archives. Make sure yourun anonymoUUs as administrator.Inplace replacements vs. replacements in a copyanonymoUUs is able to create a copy of the processed file-tree or replace it. Thesubstitutemethod takes a mandatory source-path argument (path to a file, folder or zip-archive, either a string or aPathobject) and an optional target-path argument (again, a string orPathobject). The targetneeds to refer to a folder, which can't be a sub-folder of the source-folder. The target-folder will be created if it doesn't exist.When the target argument is provided, anonymoUUs will create a processed copy of the source into the target-folder. If the source is a single file, and the file path does not contain elements that will be replaced, and the target-folder is identical to the source folder, than the processed result will get a 'copy' extension to prevent overwriting.When the target argument is omitted, the source will be overwritten by a processed version of it:# process the datadownload.zip file, replace all patterns and write
# a copy to the 'bucket' folder.
anonymize_regex.substitute(
'/Users/casper/Desktop/datadownload.zip',
'/Users/casper/Desktop/bucket'
)
# process the 'download' folder and replace the original by its processed
# version
anonymize_regex.substitute('/Users/casper/Desktop/download')
# process a single file, and replace it
anonymize_regex.substitute('/Users/casper/Desktop/my_file.json')Reading contents of a fileFiles will be opened depending on their extension. Non refognized extensions will be skipped. The standard version of this package assumes 'UTF-8' encoding. Errors are going to be ignored. Since reading file-contents is done with a single function, it will be easy to adjust (different encodings,etc) by overloading it in an extension:# standard reading functiondef_read_file(self,source:Path):f=open(source,'r',encoding='utf-8',errors='ignore')contents=list(f)f.close()returncontentsTodoCleaning up this documentTesting! Sweet momma, it needs testing.
|
anonympy
|
anonympy 🕶️With ❤️ by ArtLabsOverviewGeneral Data Anonymization library for images, PDFs and tabular data. SeeArtLabs/projectsfor more or similar projects.Main FeaturesEase of use - this package was written to be as intuitive as possible.TabularEfficient - based on pd.DataFrameNumerous anonymization methodsNumeric dataGeneralization - BinningPerturbationPCA MaskingGeneralization - RoundingCategorical dataSynthetic DataResamplingTokenizationPartial Email MaskingDatetime dataSynthetic DatePerturbationImagesAnonymization techniquesPersonal Images (faces)BlurringPixaled Face BlurringSalt and Pepper NoiseGeneral ImagesBlurringPDFFind sensitive information and cover it with black boxesText, SoundIn DevelopmentInstallationDependenciesPython (>= 3.7)cape-privacyfakerpandasOpenCVpytesseracttransformers. . . . .Install with pipEasiest way to install anonympy is usingpippip install anonympyDue to conflicting pandas/numpy versions withcape-privacy, it's recommend to install them seperatelypip install cape-privacy==0.3.0 --no-depsInstall from sourceInstalling the library from source code is also possiblegit clone https://github.com/ArtLabss/open-data-anonimizer.git
cd open-data-anonimizer
pip install -r requirements.txt
make bootstrap
pip install cape-privacy==0.3.0 --no-depsDownloading RepositoryOr you could download this repository frompypiand run the following:cd open-data-anonimizer
python setup.py installUsage ExampleMore exampleshereTabular>>>fromanonympy.pandasimportdfAnonymizer>>>fromanonympy.pandas.utils_pandasimportload_dataset>>>df=load_dataset()>>>print(df)nameagebirthdatesalarywebemailssn0Bruce331915-04-1759234.32http://www.alandrosenburgcpapc.co.ukjosefrazier@owen.com3435543341Tony481970-05-2949324.53http://[email protected]# Calling the generic function>>>anonym=dfAnonymizer(df)>>>anonym.anonymize(inplace=False)# changes will be returned, not appliednameagebirthdateagewebemailssn0Stephanie Patel301915-05-1060000.05968b7880fpjordan@example.com391-77-92101Daniel Matthews501971-01-2150000.02ae31d40d4tparks@example.org872-80-9114# Or applying a specific anonymization technique to a column>>>fromanonympy.pandas.utils_pandasimportavailable_methods>>>anonym.categorical_columns...['name','web','email','ssn']>>>available_methods('categorical')...categorical_fakecategorical_fake_autocategorical_resamplingcategorical_tokenizationcategorical_email_masking>>>anonym.anonymize({'name':'categorical_fake',# {'column_name': 'method_name'}'age':'numeric_noise','birthdate':'datetime_noise','salary':'numeric_rounding','web':'categorical_tokenization','email':'categorical_email_masking','ssn':'column_suppression'})>>>print(anonym.to_df())nameagebirthdatesalarywebemail0Paul Lang311915-04-1760000.08ee92fb1bdj*****[email protected] Gillespie421970-05-2950000.051b615c92ee*****[email protected]# Passing an Image>>>importcv2>>>fromanonympy.imagesimportimAnonymizer>>>img=cv2.imread('salty.jpg')>>>anonym=imAnonymizer(img)>>>blurred=anonym.face_blur((31,31),shape='r',box='r')# blurring shape and bounding box ('r' / 'c')>>>pixel=anonym.face_pixel(blocks=20,box=None)>>>sap=anonym.face_SaP(shape='c',box=None)blurredpixelsap# Passing a Folder>>>path='C:/Users/shakhansho.sabzaliev/Downloads/Data'# images are inside `Data` folder>>>dst='D:/'# destination folder>>>anonym=imAnonymizer(path,dst)>>>anonym.blur(method='median',kernel=11)This will create a folderOutputindstdirectory.# The Data folder had the following structure|1.jpg|2.jpg|3.jpeg|\---test|4.png|5.jpeg|\---test26.png# The Output folder will have the same structure and file names but blurred imagesPDFIn order to initializepdfAnonymizerobject we have to installpytesseractandpoppler, and provide path to the binaries of both as arguments or add paths to system variables>>>fromanonympy.pdfimportpdfAnonymizer# need to specify paths, since I don't have them in system variables>>>anonym=pdfAnonymizer(path_to_pdf="Downloads\\test.pdf",pytesseract_path=r"C:\Program Files\Tesseract-OCR\tesseract.exe",poppler_path=r"C:\Users\shakhansho\Downloads\Release-22.01.0-0\poppler-22.01.0\Library\bin")# Calling the generic function>>>anonym.anonymize(output_path='output.pdf',remove_metadata=True,fill='black',outline='black')test.pdfoutput.pdfIn case you only want to hide specific information, instead ofanonymizeuse other methods>>>anonym=pdfAnonymizer(path_to_pdf=r"Downloads\test.pdf")>>>anonym.pdf2images()# images are stored in anonym.images variable>>>anonym.images2text(anonym.images)# texts are stored in anonym.texts# Entities of interest>>>locs:dict=anonym.find_LOC(anonym.texts[0])# index refers to page number>>>emails:dict=anonym.find_emails(anonym.texts[0])# {page_number: [coords]}>>>coords:list=locs['page_1']+emails['page_1']>>>anonym.cover_box(anonym.images[0],coords)>>>display(anonym.images[0])DevelopmentContributionsTheContributing Guidehas detailed information about contributing code and documentation.Important LinksOfficial source code repo:https://github.com/ArtLabss/open-data-anonimizerDownload releases:https://pypi.org/project/anonympy/Issue tracker:https://github.com/ArtLabss/open-data-anonimizer/issuesLicenseBSD-3Code of ConductPlease seeCode of Conduct.
All community members are expected to follow it.
|
anonypy
|
AnonyPyAnonymization library for python.
AnonyPy provides following privacy preserving techniques for the anonymization.K AnonymityL DiversityT ClosenessThe Anonymization methodAnonymization method aims at making the individual record be indistinguishable among a group record by using techniques of generalization and suppression.Turning a dataset into a k-anonymous (and possibly l-diverse or t-close) dataset is a complex problem, and finding the optimal partition into k-anonymous groups is an NP-hard problem.AnonyPy uses "Mondrian" algorithm to partition the original data into smaller and smaller groupsThe algorithm assumes that we have converted all attributes into numerical or categorical values and that we are able to measure the “span” of a given attribute Xi.Install$ pip install anonypyUsageimportanonypyimportpandasaspddata=[[6,"1","test1","x",20],[6,"1","test1","x",30],[8,"2","test2","x",50],[8,"2","test3","w",45],[8,"1","test2","y",35],[4,"2","test3","y",20],[4,"1","test3","y",20],[2,"1","test3","z",22],[2,"2","test3","y",32],]columns=["col1","col2","col3","col4","col5"]categorical=set(("col2","col3","col4"))defmain():df=pd.DataFrame(data=data,columns=columns)fornameincategorical:df[name]=df[name].astype("category")feature_columns=["col1","col2","col3"]sensitive_column="col4"p=anonypy.Preserver(df,feature_columns,sensitive_column)rows=p.anonymize_k_anonymity(k=2)dfn=pd.DataFrame(rows)print(dfn)Original datacol1col2col3col4col5061test1x20161test1x30282test2x50382test3w45481test2y35542test3y20641test3y20721test3z22822test3y32The created anonymized data is below(Guarantee 2-anonymity).col1col2col3col4count02-42test3y212-41test3y122-41test3z136-81test1,test2x246-81test1,test2y1582test3,test2w1682test3,test2x1
|
anonypyx
|
AnonyPyxThis is a fork of the python libraryAnonyPyproviding data anonymization techniques.
AnonyPyx adds further algorithms (see below) and introduces a declarative interface.
If you consider migrating from AnonyPy, keep in mind that AnonyPyx is not compatible with its original API.Featurespartion-based anonymization algorithm Mondrian [1] supportingk-anonymityl-diversityt-closenessmicroclustering based anonymization algorithm MDAV-Generic [2] supportingk-anonymityinteroperability with pandas data framessupports both continuous and categorical attributesimage anonymization via the k-Same family of algorithmsInstallpipinstallanonypyxUsageDisclaimer: AnonyPyX does not shuffle the input data currently. In some applications, records can be re-identified based on the order in which they appear in the anonymized data set when shuffling is not used.Mondrian:importanonypyximportpandasaspd# Step 1: Prepare data as pandas data frame:columns=["age","sex","zip code","diagnosis"]data=[[50,"male","02139","stroke"],[33,"female","10023","flu"],[66,"intersex","20001","flu"],[28,"female","33139","diarrhea"],[92,"male","94130","cancer"],[19,"female","96850","diabetes"],]df=pd.DataFrame(data=data,columns=columns)forcolumnin("sex","zip code","diagnosis"):df[column]=df[column].astype("category")# Step 2: Prepare anonymizeranonymizer=anonypyx.Anonymizer(df,k=3,l=2,algorithm="Mondrian",feature_columns=["age","sex","zip code"],sensitive_column="diagnosis")# Step 3: Anonymize data (this might take a while for large data sets)anonymized_records=anonymizer.anonymize()# Print results:anonymized_df=pd.DataFrame(anonymized_records)print(anonymized_df)Output:agesexzipcodediagnosiscount019-33female10023,33139,96850diabetes1119-33female10023,33139,96850diarrhea1219-33female10023,33139,96850flu1350-92male,intersex02139,20001,94130cancer1450-92male,intersex02139,20001,94130flu1550-92male,intersex02139,20001,94130stroke1MDAV-generic:# Step 2: Prepare anonymizeranonymizer=anonypyx.Anonymizer(df,k=3,algorithm="MDAV-generic",feature_columns=["age","sex","zip code"],sensitive_column="diagnosis")k-Same-Eigen:importanonypyximportnumpyasnpimportcv2fromosimportlistdirfromos.pathimportisfile,join# Step 1: Load images into single numpy array# images are loaded in grayscale# every image must have the same height and widthpath_to_dir='directory/containing/images/'height=120width=128files=[fforfinlistdir(path_to_dir)ifisfile(join(path_to_dir,f))]images=[cv2.imread(join(path_to_dir,f),flags=cv2.IMREAD_GRAYSCALE)forfinlistdir(path_to_dir)ifisfile(join(path_to_dir,f))]images=np.array(images)# Step 2: Prepare anonymizeranonymizer=anonypyx.kSame(images,width,height,k=5,variant='eigen')# Step 3: Anonymizationanonymized,mapping=anonymizer.anonymize()# Display the first image and its anonymized versionsample_image=np.concatenate((images[0],anonymized[mapping[0]]),axis=1).astype('uint8')sample_image=cv2.cvtColor(sample_image,cv2.COLOR_GRAY2BGR)cv2.imshow("k-same-eigen",sample_image)cv2.waitKey(0)cv2.destroyAllWindows()ContributingClone the repository:gitclonehttps://github.com/questforwisdom/anonypyx.gitSet a virtual python environment up and install dependencies:python-mvenvvenvsourcevenv/bin/activate
pipinstall-rrequirements.txtRun tests:pytestChangelog0.2.0added the microaggregation algorithm MDAV-generic [2]added the Anonymizer class as the new APIremoved Preserver class which was superseded by Anonymizer0.2.1 - 0.2.3minor bugfixes0.2.4added k-Same family of algorithms for image anonymization [3]added the microaggregation algorithm used by k-SameReferences[1]: LeFevre, K., DeWitt, D. J., & Ramakrishnan, R. (2006). Mondrian multidimensional K-anonymity. 22nd International Conference on Data Engineering (ICDE’06), 25–25.https://doi.org/10.1109/ICDE.2006.101[2]: Domingo-Ferrer, J., & Torra, V. (2005). Ordinal, continuous and heterogeneous k-anonymity through microaggregation. Data Mining and Knowledge Discovery, 11, 195–212.[3]: E. M. Newton, L. Sweeney, and B. Malin, ‘Preserving privacy by de-identifying face images’, IEEE Transactions on Knowledge and Data Engineering, vol. 17, no. 2, pp. 232–243, Feb. 2005, doi: 10.1109/TKDE.2005.32.
|
anopool
|
anopoolis a generic thread-safe sync and async object pool implementation.
because I got tired of writing the same code over and over again.InstallpipinstallanopoolUsage#TODOLicenseMIT License
|
anoptions
|
anoptionsA python3 module to assist in defining application options and collecting user input for them from command line and environment variables.Installpip3 install anoptionsClassic modeClassic mode provides the same functionality that has existed from the initial release. Evaluating the
arguments results in an untyped dictionary.Usage (classic)Follow the example. If short_name is omitted, the first letter of the "long" name parameter is used. Duplicate short or long names are not allowed.Func is a required parameter. Give a function that converts the inputted value to the proper data type. If no conversion is desired, you can useParameter.dummy.
For flags where existence of a variable will always mark True useParameter.flag.
For flags where a more logical input parsing (for example silent='false' to be interpreted as False) is desired useParameter.bool(or justbool).Example (classic)Code (main.py):importsysfromanoptionsimportParameter,Optionsdefmain(argvs):parameters=[Parameter("host",str,"mqtt_host",default='127.0.0.1',description='MQTT Host address',examples=['127.0.0.1','localhost']),Parameter("port",int,"mqtt_port",default=1883),Parameter("topic",str,"mqtt_topic",required=True),Parameter("dir",str,"directory",always_include=True),Parameter("delta",int,"delta",short_name='D'),Parameter("silent",Parameter.flag,"silent")]app_name='APPNAME'o=Options(parameters=parameters,argvs=argvs,env_prefix=app_name)options=o.eval()# Print all valuesprint('all values',options)# Print a specific valueprint('host',options['mqtt_host'])# Print usage outputprint(o.usage(app_name))if__name__=="__main__":main(sys.argv[1:])Run:$APPNAME_PORT=1232APPNAME_SILENT=1python3main.py-d/tmp--host10.1.2.3-D60-tfoobar
allvalues{'mqtt_port':1232,'silent':True,'directory':'/tmp','mqtt_host':'10.1.2.3','delta':60,'mqtt_topic':'foobar'}host10.1.2.3
USAGE:APPNAME[OPTION...]...
Options:
-h--host[str](optional)(default:127.0.01)MQTTHostaddressExamples:127.0.0.1,localhost
-p--port[int](optional)(default:1883)port
-t--topic[str]topic
-d--dir[str](optional)dir
-D--delta[int](optional)delta
-s--silent[flag](optional)silentTyped modeTyped mode exists since version 2.0. It provides similar functionality to the classic mode,
but with a completely different way of operation. In typed mode, instead of definingParameters,
you define one pydantic model and use that model to prepare the inputs. Evaluating the arguments
results a typed class.Usage (typed)Follow the example. If short_name is omitted, the first letter of the "long" name parameter is used. Duplicate short or long names are not allowed. Defining a "variable name" like in classic mode is not supported as it does not make any sense.Instead of providing functions for type conversion from inputs, this mode of operation uses pydantic's
automatic type conversion.Example (typed)Code (main.py):importsysfromanoptionsimportTypedOptions,BaseOptionsModelfrompydanticimportFieldfromtypingimportOptionalclassOptionsModel(BaseOptionsModel):mqtt_host:str=Field(default='127.0.0.1',description='MQTT host address',examples=['127.0.0.1','localhost'],json_schema_extra={"long_name":'host',"short_name":'h'})mqtt_port:int=Field(default=1883,json_schema_extra={"long_name":'port',"short_name":'p'})mqtt_topic:str=Field(json_schema_extra={"long_name":'topic',"short_name":'t'})directory:Optional[str]=Nonedelta:Optional[int]=Field(default=None,json_schema_extra={"short_name":'D'})silent:Optional[bool]=Falsedefmain(argv):app_name='appname'o=TypedOptions(model=OptionsModel,argvs=argvs,env_prefix=app_name)options=o.eval()# Print all valuesprint('all values',options)# Print a specific valueprint('host',options.mqtt_host)# Get a dict outputprint('dict',options.model_dump())# Print usage outputprint(o.usage(app_name))if__name__=="__main__":main(sys.argv[1:])Run:$APPNAME_PORT=1232APPNAME_SILENT=1python3main.py-d/tmp--host10.1.2.3-D60-tfoobar
allvaluesmqtt_host='10.1.2.3'mqtt_port=1232mqtt_topic='foobar'directory='/tmp'delta=60silent=True
host10.1.2.3
dict{'mqtt_host':'10.1.2.3','mqtt_port':1232,'mqtt_topic':'foobar','directory':'/tmp','delta':60,'silent':True}USAGE:appname[OPTION...]...
Options:
-h--host[string](default:127.0.0.1)MQTThostaddressExamples:127.0.0.1,localhost
-p--port[integer](default:1883)MqttPort
-t--topic[string]MqttTopic
-d--directory[string](optional)Directory
-D--delta[integer](optional)Delta
-s--silent[boolean](optional)SilentDevelopmentRun unit tests:python3-munittest-vtestsLinting:pylintanoptions
|
anora
|
Anora==========================Anora is a Django template filter that determines whether or not a word should have an "a" or "an" in front of it. Adds either one of these depending on the phoenetic value of the given text. It will also automatically add one space before the text.Install-------1. ``pip install anora``2. Add ``anora`` to your ``INSTALLED_APPS``3. Add ``{% load anora %}`` to the top of templates you wish to use these tags in.Usage-------``{% load anora %}````I was taking a walk in the woods today. I came across {{ animal_type|anora }}.``Possible outcomes from the above:-------I was taking a walk in the woods today. I came across a raccoon.I was taking a walk in the woods today. I came across an owl.Credits-------Original template filter can he found [here](http://djangosnippets.org/snippets/1519/).
|
anorak
|
A data anonymization toolkit for Python.
|
anoseg
|
A collection of Anomaly Segmentation methods and an interface for easy use.
|
anospp-analysis
|
anospp-analysisPython package for ANOSPP data analysisANOSPP is the multiplexed amplicon sequencing assay for Anopheles mosquito species identification and Plasmodium detection. This repository contains the code for analysis of the sequencing results pre-processed withnf-core ampliseqpipeline.InstallationFor released versioncondainstall-cbiocondaanospp-analysisFor development setup, see instructions belowUsageKey analysis steps are implemented as standalone scripts:anospp-preptakes DADA2 output files and targets primer sequences, demultiplexes the amplicons and yields haplotypes tableanospp-qctakes haplotypes table, DADA2 stats table and samples manifest and produces QC plotsanospp-plasmblasts Plasmodium sequences against reference dataset to determine species and infer sample infection statusanospp-nncompares k-mer profiles of mosquito targets against a reference dataset and provides probabilistic species callsanospp-vaeprovides finer scale species prediction for An. gambiae complex with VAE projectionDevelopmentSetupInstallation is hybrid with conda + poetry:[email protected]:malariagen/anospp-analysis.gitcdanospp-analysis
mambaenvcreate-fenvironment.yml
condaactivateanospp_analysis_dev
poetryinstallUsage & testingThe code in this repository can be accessed via wrapper scripts:anospp-qc\--haplotypestest_data/haplotypes.tsv\--samplestest_data/samples.csv\--statstest_data/stats.tsv\--outdirtest_data/qcBesides, individual components are available as a python API:$python
>>>fromanospp_analysis.utilimport*
>>>PLASM_TARGETS['P1','P2']TODO Automated testing & CIAdding Python depsIntroducing python dependencies should be done via poetry:poetryaddpackage_nameThis should update bothpyproject.tomlandpoetry.lockfilesIf the package should be used in development environment only, usepoetryaddpackage_name--devTo update environment after changes made topyproject.tomland/orpoetry.lockpoetryinstallAdding non-Python depsIntroducing non-python dependencies should be done via conda: editenvironment.yml,
then re-create the conda environment and poetry deps:mambaenvcreate-fenvironment.yml
condaactivateanospp_analysis
poetryinstallChanges in conda environment might also introduce changes to the python installation,
in which case one should update poetry lock filepoetrylock
|
anosql
|
A Python library for using SQLInspired by the excellentYesqllibrary by Kris Jenkins. In my mother
tongue,anomeansyes.If you are on python3.6+ or needanosqlto work withasyncio-based database drivers, see the related project,aiosql.Complete documentation is available atRead The Docs.Installation$ pip install anosqlUsageBasicsGiven aqueries.sqlfile:-- name: get-all-greetings
-- Get all the greetings in the databaseSELECT*FROMgreetings;-- name: select-users
-- Get all the users from the database,
-- and return it as a dictSELECT*FROMUSERS;We can issue SQL queries, like so:importanosqlimportpsycopg2importsqlite3# PostgreSQLconn=psycopg2.connect('...')queries=anosql.from_path('queries.sql','psycopg2')# Or, Sqlite3...conn=sqlite3.connect('cool.db')queries=anosql.from_path('queries.sql','sqlite3')queries.get_all_greetings(conn)# => [(1, 'Hi')]queries.get_all_greetings.__doc__# => Get all the greetings in the databasequeries.get_all_greetings.sql# => SELECT * FROM greetings;queries.available_queries# => ['get_all_greetings']ParametersOften, you want to change parts of the query dynamically, particularly values in
theWHEREclause. You can use parameters to do this:-- name: get-greetings-for-language
-- Get all the greetings in the database for given languageSELECT*FROMgreetingsWHERElang=%s;And they become positional parameters:visitor_language="en"queries.get_greetings_for_language(conn,visitor_language)Named ParametersTo make queries with many parameters more understandable and maintainable, you
can give the parameters names:-- name: get-greetings-for-language-and-length
-- Get all the greetings in the database for given language and lengthSELECT*FROMgreetingsWHERElang=:langANDlen(greeting)<=:length_limit;If you were writing a Postgresql query, you could also format the parameters as%s(lang)and%s(length_limit).Then, call your queries like you would any Python function with named
parameters:visitor_language="en"greetings_for_texting=queries.get_greetings_for_language_and_length(conn,lang=visitor_language,length_limit=140)Update/Insert/DeleteIn order to runUPDATE,INSERT, orDELETEstatements, you need to
add!to the end of your query name. Anosql will then execute it properly.
It will also return the number of affected rows.Insert queries returning autogenerated valuesIf you want the auto-generated primary key to be returned after you run an
insert query, you can add<!to the end of your query name.-- name: create-user<!INSERTINTOperson(name)VALUES(:name)Adding custom query loaders.Out of the box,anosqlsupports SQLite and PostgreSQL via the stdlibsqlite3database driver
andpsycopg2. If you would like to extendanosqlto communicate with other types of databases,
you may create a driver adapter class and register it withanosql.core.register_driver_adapter().Driver adapters are duck-typed classes which adhere to the below interface. Looking atanosql/adapterspackage
is a good place to get started by looking at how thepsycopg2andsqlite3adapters work.To register a new loader:import anosql
import anosql.core
class MyDbAdapter():
def process_sql(self, name, op_type, sql):
pass
def select(self, conn, sql, parameters):
pass
@contextmanager
def select_cursor(self, conn, sql, parameters):
pass
def insert_update_delete(self, conn, sql, parameters):
pass
def insert_update_delete_many(self, conn, sql, parameters):
pass
def insert_returning(self, conn, sql, parameters):
pass
def execute_script(self, conn, sql):
pass
anosql.core.register_driver_adapter("mydb", MyDbAdapter)
# To use make a connection to your db, and pass "mydb" as the db_type:
import mydbdriver
conn = mydbriver.connect("...")
anosql.load_queries("path/to/sql/", "mydb")
greetings = anosql.get_greetings(conn)
conn.close()If your adapter constructor takes arguments, you can register a function which can build
your adapter instance:def adapter_factory():
return MyDbAdapter("foo", 42)
anosql.register_driver_adapter("mydb", adapter_factory)Tests$ pip install tox
$ toxLicenseBSD, short and sweet
|
anoteai
|
No description available on PyPI.
|
anot_fib
|
UNKNOWN
|
another
|
Another"Another" Python backend framework, for fun.InstallationpipinstallanotherYou also need an ASGI server, such asUvicornorGranian.pipinstalluvicorn# orpipinstallgranianUsageCreate amain.pyfile and copy-paste the following snippet into it.fromanotherimportAnother,Status,Request,Responseapp=Another()@app.get("/hello")defhellow_another(req:Request):returnResponse({"message":"Hello!","extra":req.query},status=Status.HTTP_200_OK)And then run the server:uvicornmain:appNow open this linklocalhost:8000/hello?first_name=Mads&last_name=Mikkelsenin your browser.
|
another-bigquery-magic
|
another-bigquery-magicUnofficial bigquery magic Command for IPython notebookInstallation# from pypi$pipinstallanother-bigquery-magic# alternatively, from github$gitclonehttps://github.com/kota7/another-bigquery-magic.git--depth1$pipinstall-U./another-bigquery-magicUsage# Set the project IDproject_id="<google-cloud-project-id>"!gcloudconfigsetproject{project_id}# If you are authenticated to the google cloud already, skip this cell.# Otherwise, authenticate with your choice of method.# Example 1. Authentication on colabfromgoogle.colabimportauthauth.authenticate_user()# Example 2. Authentication by user log-in# Note: to access external table with google drive,# we also need "https://www.googleapis.com/auth/drive" in the scope!gcloudauthapplication-defaultlogin--scopes="https://www.googleapis.com/auth/bigquery"# Example 3. Authentication with a local json filejsonfile="<json-file-path>"%configBigqueryMagic.localjson=jsonfile# Load the bq magic command%load_extbq# %bq magic command runs the query and returns the pandas data frame%bqSELECT1AStestStart query at 2024-01-12 15:31:07.286991
End query at 2024-01-12 15:31:10.047083 (Execution time: 0:00:02.760092, Processed: 0.0 GB)test01Seeexample.ipynbfor more examples.
|
another-crazy-thursday
|
crazy_thursday: your python REFUSE to work on Crazy Thursdaycrazy_thursday is a library that allows you to go to KFC in time on Crazy Thursday by raisingCrazyThursdayException.Usagefrom crazy_thursday import CrazyThursday
@CrazyThursday
def hello():
print('hello')
if __name__ == '__main__':
hello() # crazy_thursday.kfc.CrazyThursdayException: KFC Crazy Thursday WhoEver Gives me 50 CNY, I Will Thank Him.
|
another-demo
|
python example PackageThis is a simple example package.https://github.com/pypa/sampleproject.githttps://www.geeksforgeeks.org/what-is-setup-py-in-python/#https://packaging.python.org/en/latest/guides/installing-using-linux-tools/https://packaging.python.org/en/latest/tutorials/packaging-projects/pip install setuptools
python setup.py sdist bdist_wheel
python setup.py sdist
pip install sdk
|
another-example-pkg-ralcanta
|
No description available on PyPI.
|
another-expect
|
Another ExpectThis module is not ready for public use.
|
another-fastapi-jwt-auth
|
Another FastAPI JWT AuthSource Code:https://github.com/delrey1/another-fastapi-jwt-auth/BackgroundThis was forked fromhttps://github.com/IndominusByte/fastapi-jwt-authas it is no longer maintained.This release contains changes related to Pydantic >2 and PyJWT > 2. I used this on my own projects and will be updating
it
as required. PRs invited.FeaturesFastAPI extension that provides JWT Auth support (secure, easy to use and lightweight), if you were familiar with flask-jwt-extended this extension suitable for you, cause this extension inspired by flask-jwt-extended 😀Access tokens and refresh tokensFreshness TokensRevoking TokensSupport for WebSocket authorizationSupport for adding custom claims to JSON Web TokensStoring tokens in cookies and CSRF protectionInstallationThe easiest way to start working with this extension with pippipinstallanother-fastapi-jwt-authLicenseThis project is licensed under the terms of the MIT license.
|
another-jira-cli
|
READMETool for quick JIRA logging.See README.md for details.CHANGELOG0.17.0Date: 2018-02-06[BUGFIX]jira initdoes not delete a previously existing config file any longer0.16.0Date: 2018-02-04[FEATURE] searches can now retrieve all results, yet default limit kept at 500.15.0Date: 2018-02-02[FEATURE] “jira new” now available. might become more powerful soon.[NOTICE] versions 0.14.1 & 0.14.2 are no longer available as source due to git rebases.0.14.2Date: 2018-02-02[BUGFIX] fix dependencies in setup.py, so that pip install works again …[BUGFIX] list-work working again, output now sorted by duration0.14.0Date: 2018-02-01[FEATURE] log-work will now order the new logs after the last one0.13.0Date: 2018-02-01[FEATURE] add multiline worklog comments using -m0.12.0Date: 2018-02-01[FEATURE] made ‘today’ an alias for ‘m0’ in date strings[CHANGE] renamed command “log-time” to “log-work”[CHANGE] greatly simplified (and changed) cli semantics for log-work[CHANGE] greatly simplified (and changed) cli semantics for fill-day[BUGFIX] cleanup-day working again[BUGFIX] fill-day working again0.11.2[BUGFIX] search: fix bug when switching back to .format() strings0.11.1[BUGFIX] bulk-create: fix creation of tickets with labels from yaml & json0.11.0Date: 2017-10-30[BUGFIX] most commands: fix a bug in error handling code[BUGFIX] lookup: fixed errors in prime use cases, updated docs0.10.0Date: 2017-10-23[FEATURE] bulk-create: add –set parameter for manual field overrides[FEATURE] bulk-create: add -p/–print parameter0.9.2Date: 2017-10-23[CHANGE] go back to python 3.5 compatibility by removing f”” strings0.9.1Date: 2017-10-20[CHANGE] bulk-create command: nicer output for –dry-run0.9.0Date: 2017-10-20[FEATURE] bulk-create command: Add –filter[FEATURE] bulk-create command: Add –dry-run[FEATURE] bulk-create command: Add –start-at[FEATURE] bulk-create command: Add handling of epic_name and epic_link fields[BUGFIX] bulk-create command: Fixed index calculation for log files[CHANGE] bulk-create command: Switched to YAML output format for logs[DOCS] bulk-create-command: updated –help docs with unsupported infoNOTE: Still an experimental release.0.8.0Date: 2017-10-19[FEATURE] Add ‘bulk-create’ command from CSV, YAML and JSON files[INTERNAL] Restructured internal file layoutNOTE: This is an experimental release, it might be that things broke since there is no test coverage.0.7.0Date: 2017-06-01[FEATURE] Combine search queries in the lookup command[BUGFIX] Remove typo which introduced a syntax error[DOCS] Updated README.md in the repo0.6.0Date: 2017-06-01[FEATURE] Add command clear-searches[FEATURE] Fix command cleanup-day[DOCS] Many documentation updates0.5.0Date: 2017-05-31[FEATURE] Add command fill-day[FEATURE] Add command list-worklogs[FEATURE] Add command list-work[FEATURE] Add ‘jira’ alias in parallel to ‘jira-cli’0.4.0Date: 2017-05-31[FEATURE] Add searches and saved searches0.3.0 - 0.3.2Date: 2017-05-310.3.2 - another name change, this time to “another-jira-cli”0.3.1 - Update this file with correct version nr :)0.3.0 - Update project metadata0.3.0 - Change project name to “jiracli” (jira-cli did exist on pypi before)0.2.0Date: 2017-05-31Add ticket aliases0.1.0Date: 2017-04-07Initial release
|
another-linked-list
|
Another Linked ListTable of ContentsWhat is it?Why create it?Simple usageApiclass LinkedList([a list of elements])AttributesMethodsnodeTestWhat is it?An incomprehensive implementation of a doubly-linked listWhy create it?I didn't like the api or documentation of other linked lists. I'm also new
to python so this was a good way to learn.Simple usagefromanother_linked_listimportLinkedList# create a list with three nodesll=LinkedList(["a","b","d"])# get the node with element "b"bNode=ll.findFirstNode("b")# insert "c" after bNodell.insertAfter(bNode,"c")print(list(ll))# prints ['a', 'b', 'c', 'd']Apiclass LinkedList([a list of elements])the linked list holds a list ofnodes. Each node holds an element
(the value) along with pointers to the previous and next nodes. For the most
part the methods are intended to allow you to work with the elements moreso
than the nodes because that was my use-case. This design decision may change
in the future to be more focused around the nodes.all methods returnselfunless specified otherwiseall methods which take a list argument also accept an instance of LinkedListin all code examples below, assumellstarts withLinkedList(["a", "c"])the internal methods implemented are__copy____iter__ (iterates over the elements,notthe nodes)__len____reversed__AttributesfirstNode:nodeprint(ll.firstNode.element)# alastNode:nodeprint(ll.lastNode.element)# cMethodsappend(element)ll.append('d')print(list(ll))# ['a', 'c', 'd']copy() => LinkedListappendAll(list)ll.appendAll(['d','e'])print(list(ll))# ['a', 'c', 'd', 'e']findFirstNode(element) =>nodecNode=ll.findFirstNode(['c'])print(cNode.element)# cinsertAfter(node, element)ll.insertAfter(ll.firstNode,'b')print(list(ll))# ['a', 'b', 'c']insertAllAfter(node, list)ll.insertAllAfter(ll.firstNode,['b','d'])print(list(ll))# ['a', 'b', 'd', 'c']insertAllBefore(node, list)ll.insertAllBefore(ll.lastNode,['b','d'])print(list(ll))# ['a', 'b', 'd', 'c']insertBefore(node, element)ll.insertBefore(ll.lastNode,'b')print(list(ll))# ['a', 'b', 'c']prepend(element)ll.prepend('z')print(list(ll))# ['z', 'a', 'c']prependAll(list)ll.prependAll(['y','z'])print(list(ll))# ['y', 'z', 'a', 'c']removeFirstElement(element)ll.removeFirstElement('c')print(list(ll))# ['a']removeNode(node)ll.removeNode(ll.firstNode)print(list(ll))# ['c']nodea node is just an instance of SimpleNamespace with three attributeselement: <can be anything>next_: nodeprevious: nodeprint(ll.firstNode.element)# aprint(ll.firstNode.next_.element)# cprint(ll.lastNode.previous.element)# aprint(ll.firstNode.previousisNone)# TrueTest## you must have poetry installed#$poetryshell
$poetryinstall
$pythonrunTests.py
|
another-name-of-distributions
|
No description available on PyPI.
|
another_neural_net
|
No description available on PyPI.
|
anotherpdfmerger
|
anotherpdfmergerThis is a small program to concatenate PDFs and add bookmarks where the
start of each PDF begins. The bookmarks have the same filename as the
PDF, minus the.pdfextension.There are a few of these programs around, but none that had the exact
formatting I wanted. So here's another one.Install this withsudo pip3 install anotherpdfmergeror just run therun_anotherpdfmerger.pyscript directly.Either way, if you want to merge1.pdf,2.pdf, and3.pdfintocombined.pdf, runanotherpdfmerger 1.pdf 2.pdf 3.pdf combined.pdf
|
another_ping
|
No description available on PyPI.
|
another-repo
|
has two function long description
|
another-sd-client
|
Another SD ClientSD client library for communicating with SD LønGetting startedTo make it easy for you to get started with GitLab, here's a list of recommended next steps.Already a pro? Just edit this README.md and make it your own. Want to make it easy?Use the template at the bottom!Add your filesCreateoruploadfilesAdd files using the command lineor push an existing Git repository with the following command:cd existing_repo
git remote add origin https://git.magenta.dk/rammearkitektur/another-sd-client.git
git branch -M master
git push -uf origin masterIntegrate with your toolsSet up project integrationsCollaborate with your teamInvite team members and collaboratorsCreate a new merge requestAutomatically close issues from merge requestsEnable merge request approvalsAutomatically merge when pipeline succeedsTest and DeployUse the built-in continuous integration in GitLab.Get started with GitLab CI/CDAnalyze your code for known vulnerabilities with Static Application Security Testing(SAST)Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto DeployUse pull-based deployments for improved Kubernetes managementSet up protected environmentsEditing this READMEWhen you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you tomakeareadme.comfor this template.Suggestions for a good READMEEvery project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.NameChoose a self-explaining name for your project.DescriptionLet people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.BadgesOn some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.VisualsDepending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.InstallationWithin a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.UsageUse examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.SupportTell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.RoadmapIf you have ideas for releases in the future, it is a good idea to list them in the README.ContributingState if you are open to contributions and what your requirements are for accepting them.For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.Authors and acknowledgmentShow your appreciation to those who have contributed to the project.LicenseFor open source projects, say how it is licensed.Project statusIf you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
another-setuptools-git-version
|
another-setuptools-git-versionAutomatically set package version from Git. This is a re-release of
[bad-setuptools-git-version][] with fixes and improvements, which is itself a re-release ofsetuptools-git-versionIntroductionInstead of hard-coding the package version insetup.pylike:setup(name='foobar',version='1.0.0',...)this package allows to extract it from tags in the underlying Git repository:setup(name='foobar',version_config={"version_format":"{tag}.{cc}","starting_version":"0.1.0"},setup_requires=['bad-setuptools-git-version'],...)The tool uses the semantically-latest tag as the base version. If there are no annotated tags, the version specified bystarting_versionwill be used. IfHEADis at the tag, the version will be the tag itself. If there are commits ahead of the tag, the first 8 characters of the sha of theHEADcommit will be included.
|
another-statistic-distributions
|
# another-statistic-distributions
Basic python package for statistic distributions
|
anotherstupidpackage
|
# Getting startedThis is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.## How to BuildYou must have Python ```2 >=2.7.9``` or Python ```3 >=3.4``` installed on your system to install and run this SDK. This SDK package depends on other Python packages like nose, jsonpickle etc.These dependencies are defined in the ```requirements.txt``` file that comes with the SDK.To resolve these dependencies, you can use the PIP Dependency manager. Install it by following steps at [https://pip.pypa.io/en/stable/installing/](https://pip.pypa.io/en/stable/installing/).Python and PIP executables should be defined in your PATH. Open command prompt and type ```pip --version```.This should display the version of the PIP Dependency Manager installed if your installation was successful and the paths are properly defined.* Using command line, navigate to the directory containing the generated files (including ```requirements.txt```) for the SDK.* Run the command ```pip install -r requirements.txt```. This should install all the required dependencies.## How to UseThe following section explains how to use the Swaggerpetstore SDK package in a new project.### 1. Open Project in an IDEOpen up a Python IDE like PyCharm. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.Click on ```Open``` in PyCharm to browse to your generated SDK directory and then click ```OK```.The project files will be displayed in the side bar as follows:### 2. Add a new Test ProjectCreate a new directory by right clicking on the solution name as shown below:Name the directory as "test"Add a python file to this project with the name "testsdk"Name it "testsdk"In your python file you will be required to import the generated python library using the following code lines```Pythonfrom anotherstupidpackage.anotherstupidpackage_client import AnotherstupidpackageClient```After this you can write code to instantiate an API client object, get a controller object and make API calls. Sample code is given in the subsequent sections.### 3. Run the Test ProjectTo run the file within your test project, right click on your Python file inside your Test project and click on ```Run```## How to TestYou can test the generated SDK and the server with automatically generated testcases. unittest is used as the testing framework and nose is used as the testrunner. You can run the tests as follows:1. From terminal/cmd navigate to the root directory of the SDK.2. Invoke ```pip install -r test-requirements.txt```3. Invoke ```nosetests```## Initialization### AuthenticationIn order to setup authentication and initialization of the API client, you need the following information.| Parameter | Description ||-----------|-------------|| o_auth_client_id | OAuth 2 Client ID || o_auth_redirect_uri | OAuth 2 Redirection endpoint or Callback Uri |API client can be initialized as following.```python# Configuration parameters and credentialso_auth_client_id = 'o_auth_client_id' # OAuth 2 Client IDo_auth_redirect_uri = 'o_auth_redirect_uri' # OAuth 2 Redirection endpoint or Callback Uriclient = AnotherstupidpackageClient(o_auth_client_id, o_auth_redirect_uri)```# Class Reference## <a name="list_of_controllers"></a>List of Controllers* [PetController](#pet_controller)* [StoreController](#store_controller)* [UserController](#user_controller)## <a name="pet_controller"></a> PetController### Get controller instanceAn instance of the ``` PetController ``` class can be accessed from the API Client.```pythonpet_controller = client.pet```### <a name="update_pet"></a> update_pet> Update an existing pet```pythondef update_pet(self,body)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| body | ``` Required ``` | Pet object that needs to be added to the store |#### Example Usage```pythonbody = Pet()pet_controller.update_pet(body)```#### Errors| Error Code | Error Description ||------------|-------------------|| 400 | Invalid ID supplied || 404 | Pet not found || 405 | Validation exception |### <a name="add_pet"></a> add_pet> Add a new pet to the store```pythondef add_pet(self,body)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| body | ``` Required ``` | Pet object that needs to be added to the store |#### Example Usage```pythonbody = Pet()pet_controller.add_pet(body)```#### Errors| Error Code | Error Description ||------------|-------------------|| 405 | Invalid input |### <a name="find_pets_by_status"></a> find_pets_by_status> Multiple status values can be provided with comma separated strings```pythondef find_pets_by_status(self,status)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| status | ``` Required ``` ``` Collection ``` | Status values that need to be considered for filter |#### Example Usage```pythonstatus = [Status7Enum.AVAILABLE]result = pet_controller.find_pets_by_status(status)```#### Errors| Error Code | Error Description ||------------|-------------------|| 400 | Invalid status value |### <a name="find_pets_by_tags"></a> find_pets_by_tags> Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.```pythondef find_pets_by_tags(self,tags)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| tags | ``` Required ``` ``` Collection ``` | Tags to filter by |#### Example Usage```pythontags = ['tags']result = pet_controller.find_pets_by_tags(tags)```#### Errors| Error Code | Error Description ||------------|-------------------|| 400 | Invalid tag value |### <a name="get_pet_by_id"></a> get_pet_by_id> Returns a single pet```pythondef get_pet_by_id(self,pet_id)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| petId | ``` Required ``` | ID of pet to return |#### Example Usage```pythonpet_id = 198result = pet_controller.get_pet_by_id(pet_id)```#### Errors| Error Code | Error Description ||------------|-------------------|| 400 | Invalid ID supplied || 404 | Pet not found |### <a name="update_pet_with_form"></a> update_pet_with_form> Updates a pet in the store with form data```pythondef update_pet_with_form(self,pet_id,name=None,status=None)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| petId | ``` Required ``` | ID of pet that needs to be updated || name | ``` Optional ``` | Updated name of the pet || status | ``` Optional ``` | Updated status of the pet |#### Example Usage```pythonpet_id = 35name = 'name'status = 'status'pet_controller.update_pet_with_form(pet_id, name, status)```#### Errors| Error Code | Error Description ||------------|-------------------|| 405 | Invalid input |### <a name="delete_pet"></a> delete_pet> Deletes a pet```pythondef delete_pet(self,pet_id,api_key=None)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| petId | ``` Required ``` | Pet id to delete || apiKey | ``` Optional ``` | TODO: Add a parameter description |#### Example Usage```pythonpet_id = 35api_key = 'api_key'pet_controller.delete_pet(pet_id, api_key)```#### Errors| Error Code | Error Description ||------------|-------------------|| 400 | Invalid ID supplied || 404 | Pet not found |### <a name="upload_file"></a> upload_file> uploads an image```pythondef upload_file(self,pet_id,additional_metadata=None,file=None)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| petId | ``` Required ``` | ID of pet to update || additionalMetadata | ``` Optional ``` | Additional data to pass to server || file | ``` Optional ``` | file to upload |#### Example Usage```pythonpet_id = 35additional_metadata = 'additionalMetadata'file = open("pathtofile", 'rb')result = pet_controller.upload_file(pet_id, additional_metadata, file)```[Back to List of Controllers](#list_of_controllers)## <a name="store_controller"></a> StoreController### Get controller instanceAn instance of the ``` StoreController ``` class can be accessed from the API Client.```pythonstore_controller = client.store```### <a name="get_inventory"></a> get_inventory> Returns a map of status codes to quantities```pythondef get_inventory(self)```#### Example Usage```pythonresult = store_controller.get_inventory()```### <a name="create_place_order"></a> create_place_order> *Tags:* ``` Skips Authentication ```> Place an order for a pet```pythondef create_place_order(self,body)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| body | ``` Required ``` | order placed for purchasing the pet |#### Example Usage```pythonbody = Order()result = store_controller.create_place_order(body)```#### Errors| Error Code | Error Description ||------------|-------------------|| 400 | Invalid Order |### <a name="get_order_by_id"></a> get_order_by_id> *Tags:* ``` Skips Authentication ```> For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions```pythondef get_order_by_id(self,order_id)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| orderId | ``` Required ``` | ID of pet that needs to be fetched |#### Example Usage```pythonorder_id = 35result = store_controller.get_order_by_id(order_id)```#### Errors| Error Code | Error Description ||------------|-------------------|| 400 | Invalid ID supplied || 404 | Order not found |### <a name="delete_order"></a> delete_order> *Tags:* ``` Skips Authentication ```> For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors```pythondef delete_order(self,order_id)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| orderId | ``` Required ``` | ID of the order that needs to be deleted |#### Example Usage```pythonorder_id = 35store_controller.delete_order(order_id)```#### Errors| Error Code | Error Description ||------------|-------------------|| 400 | Invalid ID supplied || 404 | Order not found |[Back to List of Controllers](#list_of_controllers)## <a name="user_controller"></a> UserController### Get controller instanceAn instance of the ``` UserController ``` class can be accessed from the API Client.```pythonuser_controller = client.user```### <a name="create_user"></a> create_user> *Tags:* ``` Skips Authentication ```> This can only be done by the logged in user.```pythondef create_user(self,body)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| body | ``` Required ``` | Created user object |#### Example Usage```pythonbody = User()user_controller.create_user(body)```#### Errors| Error Code | Error Description ||------------|-------------------|| 0 | successful operation |### <a name="create_users_with_array_input"></a> create_users_with_array_input> *Tags:* ``` Skips Authentication ```> Creates list of users with given input array```pythondef create_users_with_array_input(self,body)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| body | ``` Required ``` ``` Collection ``` | List of user object |#### Example Usage```pythonbody = [User()]user_controller.create_users_with_array_input(body)```#### Errors| Error Code | Error Description ||------------|-------------------|| 0 | successful operation |### <a name="create_users_with_list_input"></a> create_users_with_list_input> *Tags:* ``` Skips Authentication ```> Creates list of users with given input array```pythondef create_users_with_list_input(self,body)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| body | ``` Required ``` ``` Collection ``` | List of user object |#### Example Usage```pythonbody = [User()]user_controller.create_users_with_list_input(body)```#### Errors| Error Code | Error Description ||------------|-------------------|| 0 | successful operation |### <a name="get_login_user"></a> get_login_user> *Tags:* ``` Skips Authentication ```> Logs user into the system```pythondef get_login_user(self,username,password)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| username | ``` Required ``` | The user name for login || password | ``` Required ``` | The password for login in clear text |#### Example Usage```pythonusername = 'username'password = 'password'result = user_controller.get_login_user(username, password)```#### Errors| Error Code | Error Description ||------------|-------------------|| 400 | Invalid username/password supplied |### <a name="get_logout_user"></a> get_logout_user> *Tags:* ``` Skips Authentication ```> Logs out current logged in user session```pythondef get_logout_user(self)```#### Example Usage```pythonuser_controller.get_logout_user()```#### Errors| Error Code | Error Description ||------------|-------------------|| 0 | successful operation |### <a name="get_user_by_name"></a> get_user_by_name> *Tags:* ``` Skips Authentication ```> Get user by user name```pythondef get_user_by_name(self,username)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| username | ``` Required ``` | The name that needs to be fetched. Use user1 for testing. |#### Example Usage```pythonusername = 'username'result = user_controller.get_user_by_name(username)```#### Errors| Error Code | Error Description ||------------|-------------------|| 400 | Invalid username supplied || 404 | User not found |### <a name="update_user"></a> update_user> *Tags:* ``` Skips Authentication ```> This can only be done by the logged in user.```pythondef update_user(self,username,body)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| username | ``` Required ``` | name that need to be updated || body | ``` Required ``` | Updated user object |#### Example Usage```pythonusername = 'username'body = User()user_controller.update_user(username, body)```#### Errors| Error Code | Error Description ||------------|-------------------|| 400 | Invalid user supplied || 404 | User not found |### <a name="delete_user"></a> delete_user> *Tags:* ``` Skips Authentication ```> This can only be done by the logged in user.```pythondef delete_user(self,username)```#### Parameters| Parameter | Tags | Description ||-----------|------|-------------|| username | ``` Required ``` | The name that needs to be deleted |#### Example Usage```pythonusername = 'username'user_controller.delete_user(username)```#### Errors| Error Code | Error Description ||------------|-------------------|| 400 | Invalid username supplied || 404 | User not found |[Back to List of Controllers](#list_of_controllers)
|
another-sudoku-library
|
Another Sudoku LibraryLibrary for generating and solving Sudoku puzzles.Free software: MIT licenseDocumentation:https://another-sudoku-library.readthedocs.io.FeaturesGenerate new, random puzzlesSolve puzzlesCheck correctness of puzzlesCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2023-01-10)First release on PyPI.
|
another-test-package
|
No description available on PyPI.
|
anothertimer
|
Repository:https://github.com/dangcpham/anothertimerJust another timer for code timing. anothertimer enables easy timing for code runs, saving timing data, and provides basic plotting capabilities. Example usage:from anothertimer import Timer
timer = Timer()
timer.tic()
#some code here
timer.toc()Saving and loading data (modes ‘a’ for append and ‘w’ for write):timer.dump('example.csv', mode='a')
timer.load('example2.csv')Plotting can be done via:timer.plot()Check out example.py on GitHub for some more features (stopwatch/sections) and plots!Installationpip install anothertimerDependeciesStandard Python libraries (typing, time, os, csv).matplotlib (optional) - for plotting.OverheadMeasured by pstats on example.py, core functionalities causes minimal (<0.001s)
overhead. Plotting causes some overhead (due to matplotlib plotting, on the
order of a few seconds), so plot carefully.PrecisionCurrently, anothertimer uses the time.time() function to keep track of time. The precision is in the sub-second range (read more about Python timing athttps://www.python.org/dev/peps/pep-0564/,https://stackoverflow.com/questions/1938048/high-precision-clock-in-python). Currently, it is not a good idea to use this package for high precision applications, consider the timeit module.
|
another-validator
|
UNKNOWN
|
anouman
|
Anouman is a django site deployment tool that is designed to greatly
simplify the process of deployingDjangoprojects behindgunicorn/nginx. In
the spirit of reusing great open source software Anouman makes use ofvirtualenv,virtualenvwrapper,
and of coursedjangoto help manage
the process of deploying your django projects.The easiest way to become familiar with Anouman is to dive in and use it
by following along with the tutorial below. However, before you begin
you will first need to installvagrantandvirtualbox. You will be using
these tools to build a fresh Ubuntu VM to test your django deployment
on.Disclaimer:Anouman is still very much alpha stage software. As
such it has only been tested on Ubuntu 12.04 using the BASH shell. I’d
love to hear from others if they get this working in other OS/SHELL
combinations.Install AnoumanSwitch to the python virtualenv you use for development. You are usingvirtualenvfor python
development right? If not Anouman should still work with your python
system packages.source /path/to/your/virtualenv/activate
pip install anoumanVirtual Machine Creation and ProvisioningStep 1:VM Creationanouman --vm test1This command uses vagrant to create and spin up a virtual machine in a
directory called test1. As part of this process anouman created an
account with sudo privileges. Go ahead and login with
user/password=anouman/anouman:ssh [email protected] # Password *anouman*Step 2:Final provisioningIf you are using sqlite as your database you may skip this step.If you are using MySQL or Postgres you will need to install them now.
For MySQL:sudo apt-get install mysql-serverYou will then need to login to the mysql server and create/setup the
appropriate database for your django project.If you are usingPostgresyou will
need to follow a similarprotocalto setup
your Postgres database.Assuming this worked then you are ready to walk through the Anouman
tutorial and deploy your django project on a fresh virtual machine.Anouman Setup and Deployment TutorialSection 1: PackagingThis section will assume you have a django project calledexample.
Most likely your project is not namedexampleso follow along with
your own project by simply replacingexamplewith your project’s name.Before you begin make sure to open a new Terminal window.Step 1:Create Anouman PackageIn this step you will use Anouman to create a deployable package from
your django project. Start by navigating to the directory containing
your django project. This is the directory you originally randjango-admin.py startprojectfrom. For instance if you randjango-admin start-project examplefrom your home directory then you
want to be in your home directory when you issue the following command:anouman --django-project=example --domainname=example.comBehind the scenes your django project was copied into a directory named
example.com/src. Inside this directory is another file which contains a
listing of python packages you are using for your django projects. This
was determiend from the output of “pip freeze”. Lastly this directory
was tarred and gzipped. AKA an anouman package/bundle.Section2: DeployingStep 1:Copy files to serverScp your Anouman bundle to the virtual machine we created above and then
log in.scp example.com.tar.gz [email protected]:/home/anoumanIf you are using sqlite and it is not contained in your project
directory then you will now need to copy it to the VM as well.A future
version will take care of copying your database to a default location
and updating your setting fileReturn to the terminal where you are logged into your vm or relogin
with:ssh [email protected] 2:Install Anouman into the servers system python repository.sudo pip install anoumanStep 3:Setup Anouman and deploy your new project.Anouman requires all projects to be installed as a non root user.The first time you run Anouman it will install itself and in the process
create a wrapped ‘anouman‘ virtualenv as well as a wrapped
‘example.com‘ virtualenv.anouman --deploy example.com.tar.gzFollow the intructions when this command finishes to update/source your
.bash_profile. You should now have your web site deployed behind
nginx/gunicorn. Your projects system packages are now located in the
default virtualenv wrapper location/home/anouman/.virtualenvs/example.com. If you are unfamiliar with thevirtualenvwrapperI highly recommend taking a little time to become familiar with it.Anouman has also modified your STATIC_ROOT and MEDIA_ROOT variables in
settings.py to point toexample.com/staticandexample.com/mediarespectively. The goal here is to have each site completely contained in
a single directory with nginx logs, gunicorn logs, static files, and
your source code.This makes it trivial to move your site to a new
server using anouman.Your site should now be running behind nginx/gunicon with static files
properly being servered, however you still have a few steps remaining
before everything will work correctly.STep 4:Ensure your database settings are correct.Your site should now be deployed into a directory called/home/anouman/example.com. Your original django project can be found
inexample.com/src. Please update the DATABASE section of settings.py
so that it points to your database. If it was a MySQL or Postgres DB
running on localhost then you may only need to populate the database. If
it was MySQL or Postgres on a remotely accessible database then you
likely have nothing to do.If you are using an sqlite database then I recommend you create
example.com/DB and copy your sqlite database into this directory. If you
are following along with the tutorial then you would change the DATABASE
NAME section in your settings.py file to
/home/anouman/example.com/DB/{name_of_your_db}Step 5Explore Anouman Shell CommandsAssuming you updated and sourced .bash_profile at the end of the
deployment step you will now have a few shell commands that were
appended to the end of your sites virtualenv activate script which is
locate in . For instance to check the status of gunicorn/nginx type:site statusNow let’s bring it up..site startLikewise you can stop your site with:site stopGo ahead and bring the site back up:site startYou can force nginx to do a reload with:site reloadThese site management commands are specific to the site curently being
worked on. If you install another django project Anouman will gladly set
it up for you and ensure that nginx properly directs traffic to the
appropriate django back end and it’s all managed with virtualenv and
virtualenvwrapper. To switch between sites deployed with Anouman is as
simple as switching wrapped virtualenv’s. For ex: workon example.com,
workon site2.com, etc.Step 6:Adjust client/etc/hostsfile to simulate DNS for your web
site.First make sure your site is running (see step 5). Next, add the
following line to your/etc/hosts.192.168.100.100 www.example.com example.comIf you setup another site, say site2.com, on the same server then you
would add another line to /etc/hsots192.168.100.100 www.site2.com site1.comNGINX will now properly direct traffic based on the URL to the correct
gunicorn/django backend as well as server the correct static files for
the given project.Step 7:Now point your browser to example.com and you should see
your django website. Enjoy.
|
anova
|
anovauniform access to multiple ANOVA functionsTo install:pip install anova
|
anova-analysis
|
Failed to fetch description. HTTP Status Code: 404
|
anova-ble
|
Anova BLE APIBuilt for use with Home Assistant / Bleak
|
anovate-ai-dataset-download
|
No description available on PyPI.
|
anova-utils
|
WIP...
|
anova-wifi
|
Anova WifiA package to get read only data from Anova precision cookers with wifiInstallationInstall this via pip (or your favourite package manager):pip install anova-wifiContributors ✨Thanks goes to these wonderful people (emoji key):Luke💻🤔📖This project follows theall-contributorsspecification.
Contributions of any kind welcome!CreditsThis package was created withCopierand thebrowniebroke/pypackage-templateproject template.This is heavily based off of information
fromthis reddit postby/u/InitializedVariable
|
anovelmous-grammar
|
UNKNOWN
|
anovos
|
AnovosAnovosis an open source library for feature engineering at scale.
Built by data scientists & ML Engineers for the data science community,
it provides all the capabilities required for data ingestion, data analysis,
data drift & data stability analysis, feature recommendation and feature composition.
In addition, it automatically produces easily interpretable professional data reports
that help users understand the nature of data at first sight and further enable data
scientists to identify and engineer features.Leveraging the power ofApache Sparkbehind the scenes,Anovosimproves data scientists' productivity and helps them build more resilient
and better performing models.Quick StartThe easiest way to try outAnovosand explore its capabilities is through the providedexamplesthat you can run via Docker without the need to install anything
on your local machine.# Launch an anovos-examples Docker containersudodockerrun-p8888:8888anovos/anovos-examples-3.2.2:latestTo reach the Jupyter environment, open the link tohttp://127.0.0.1:8888/?token...generated by the Jupyter NotebookApp.If you're not familiar withAnovosor feature engineering, theGetting Started with
Anovosguide is a good place to begin your journey.
You can find it in the/guidesfolder within the Jupyter environment.For more detailed instructions on how to install Docker and how to troubleshoot potential
issues, see theexamples README.Using AnovosRequirementsTo useAnovos, you need compatible versions ofApache Spark,
Java and Python.Currently, we officially support the following combinations:Apache Spark 2.4.x on Java 8 with Python 3.7.xApache Spark 3.1.x on Java 11 with Python 3.9.xApache Spark 3.2.x on Java 11 with Python 3.10.xTo see what we're currently testing, seethis configuration.InstallationYou can install the latest release ofAnovosdirectly throughPyPI:pipinstallanovosDocumentationWe provide a comprehensive documentation atdocs.anovos.aithat includesuser guidesas well as a detailedAPI documentation.For usage examples, see the providedinteractive guides and Jupyter notebooksas well as
theSpark demo.OverviewRoadmapAnovoshas designed for to support any feature engineering tasks in a scalable form.
To see what's planned for the upcoming releases, see ourroadmap.Development VersionTo try out the latest additions toAnovos, you can install it directly fromGitHub:pipinstallgit+https://github.com/anovos/anovos.gitPlease note that this version is frequently updated and might not be fully compatible with the documentation available
atdocs.anovos.ai.ContributeWe're always happy to discuss and accept improvements toAnovos. To get started, please refer to
ourContributing to Anovospage in the documentation.To start coding, clone this repository, install both the regular and development requirements,
and set up the pre-commit hooks:gitclonehttps://github.com/anovos/anovos.gitcdanovos/
pipinstall-rrequirements.txt
pipinstall-rdev_requirements.txt
pre-commitinstall
|
anpan
|
anpanKanban CLI for Foam
|
anpl
|
Anchor Programming LanguageBuilding and InstallingAnchor requires Python 3.9 or laterPyPI [Recommended]Install the latest release fromThe Python Package Index (PyPI):pip install anplBuild and install locallyRun the following commands in order:python3 -m pip install --upgrade pip
python3 -m pip install --upgrade build
python3 -m build
pip install ./dist/anpl-<version>.tar.gz --force-reinstallRunningRun the Anchor compiler:an [option] [file]an --helpfor more informationGetting StartedThis is an example of the Anchor code to printHello, World!:print("Hello, World!");This is an example of the Anchor code to define a class:class[public] MyClass
begin
property[public, get, set] x: Integer;
method[public, factory] MyClass() -> MyClass
begin
this.x = 0;
this.printSomething();
return this;
end
method[public, factory] MyClass(x: Integer) -> MyClass
begin
this.x = x;
return this;
end
method[private] printSomething() -> Null
begin
print("this is a private method");
end
endThis is an example of the legacy function definition to return a string:function myFunc() -> String
begin
return "a legacy function";
endContributingI am excited to work alongside you to build and enhance Anchor Programming Language!BEFORE you start work on a feature/fix, please read and follow theContributor's Guideto help avoid any wasted or duplicate effort.Code of ConductThis project has adopted theContributor Covenant Code of Conduct. For more information [email protected] any additional questions or comments.
|
a-n-plus-b
|
ANPlusBThis tiny package provides a handy parser
for parsing the CSS<An+B>microsyntax.InstallationThis package is availableon PyPI:$pipinstalla-n-plus-bUsageThis package only ever parsesthe<An+B>microsyntax.
It does not supporttheof <selector>syntax.Examples>>>froma_n_plus_bimportANPlusB>>>ANPlusB(2,1)ANPlusB(2n+1)>>>str(_)'2n+1'>>>ANPlusB(4)ANPlusB(4)>>>ANPlusB(4,0)ANPlusB(4n)>>>{ANPlusB(1,0),ANPlusB(True,False)}{ANPlusB(n)}>>>fromitertoolsimportislice>>>ANPlusB(3,2)ANPlusB(3n+2)>>>values=_.values()>>>values_InfiniteRange(start = 2, step = 3)>>>list(islice(values,10))[2, 5, 8, 11, 14, 17, 20, 23, 26, 29]>>>6405429723686292014invaluesTrue>>>instance=ANPlusB(4,-7)>>>list(instance.indices(40))[1, 5, 9, 13, 17, 21, 25, 29, 33, 37]>>>list(instance.indices(40,from_last=True))[40, 36, 32, 28, 24, 20, 16, 12, 8, 4]>>>list(instance.indices(40,order='descending'))[37, 33, 29, 25, 21, 17, 13, 9, 5, 1]>>>list(instance.indices(40,from_last=True,order='ascending'))[4, 8, 12, 16, 20, 24, 28, 32, 36, 40]>>>ANPlusB.parse('odd')ANPlusB(2n+1)>>>ANPlusB.parse('even')ANPlusB(2n)>>>ANPlusB.parse('4')ANPlusB(4)>>>ANPlusB.parse('-1n')ANPlusB(-n)>>>ANPlusB.parse('+0n-8')ANPlusB(-8)>>>ANPlusB.parse('0n+0124')ANPlusB(124)>>>ANPlusB.from_complex(5j-2)ANPlusB(5n-2)ContributingPlease seeContributingfor more information.
|
anpp
|
README在多个Android项目自由跳转脚本,包含自动补全,可以直接修改template或者修改json配置进行安装,支持自定义命令目录一、安装及使用二、配置方法2.1 修改androiddir.bash.template2.2 修改config.json三、install3.1 直接安装androiddir.bash.template修改3.2 安装config.json修改四、clean五、使用方法5.1 自动补全使用5.2 项目源代码跳转5.3 其他跳转命令六、自定义命令七、自定义别名一、安装及使用pip3 install anppanpp-build new.
├── LICENSE
├── Makefile
├── androiddir.bash
├── androiddir.bash.template
├── config.json
├── custom.sh
├── generator.py
└── tools
└── custom.py二、配置方法2.1 修改androiddir.bash.template修改文件数组:androiddir.bash.templatedefaultPath:所有项目的根目录projects: 项目文件夹名products:项目对应的产品名kernels:内核相对路径,相对于projectsdtss:dts相对路径,相对kernelsbootloaderStage1s:第一阶段bootloaderbootloaderStage2s:第二阶段bootloaderouts:out目录,不含product名efuses:签名工具目录components:跳转命令别命(alias)2.2 修改config.json修改json数据:config.jsondefaultPath:所有项目的根目录project_keys:用于定义project支持哪些属性,定义了但是在project中没有赋值的会使用.(路径)替代project: 项目文件夹名product:项目对应的产品名kernel:内核相对路径,相对于projectsdts:dts相对路径,相对kernelsbootloaderStage1s:第一阶段bootloaderbootloaderStage2s:第二阶段bootloaderout:out目录,不含product名efuse:签名工具目录components:用于合成路径,以及shell命令的aliascmd:shell命令aliascombine:使用project_keys中的属性,完成cmd命令的路径组合三、安装anpp shell脚本3.1 直接安装androiddir.bash.template修改make templatecp androiddir.bash.template ~/.androiddir.sh
check if source .androiddir.sh path in /home/pi/.bashrc:
.androiddir.sh path not source in /home/pi/.bashrc
tail ~/.bashrc last 2 line for terminal check
~/.bashrc content
...
# add anpp(https://github.com/ZengjfOS/anpp) function to bash env
source ~/.androiddir.shsource ~/.bashrc3.2 安装config.json模版以下三条命令执行的内容是一致的makemake jsonmake installmake logpython3 ./generator.py ~/.androiddir.sh
defaultPath: ~/zengjf/
projects: ['M0-project', 'A00-project', 'M8-project', 'L00-project']
products: ['M0', 'k61v1_64_bsp', 'k62v1_64', 's138']
kernels: ['kernel-4.9', 'kernel-4.9', 'kernel-4.19', 'android/kernel/msm-4.14']
bootloaderStage1s: ['vendor/mediatek/proprietary/bootable/bootloader/preloader', 'vendor/mediatek/proprietary/bootable/bootloader/preloader', 'vendor/mediatek/proprietary/bootable/bootloader/preloader', 'android/fibo/bp_code/boot_images']
bootloaderStage2s: ['vendor/mediatek/proprietary/bootable/bootloader/lk', 'vendor/mediatek/proprietary/bootable/bootloader/lk', 'vendor/mediatek/proprietary/bootable/bootloader/lk', 'android/bootable/bootloader/edk2']
outs: ['out/target/product', 'out/target/product', 'out/target/product', 'android/out/target/product']
efuses: ['vendor/mediatek/proprietary/scripts/sign-image_v2', 'vendor/mediatek/proprietary/scripts/sign-image_v2', 'vendor/mediatek/proprietary/scripts/sign-image_v2', 'sc13x_download_images_v2/qcm6125-la-2-0/common/sectools']
check if source .androiddir.sh path in /home/pi/.bashrc:
.androiddir.sh path not source in /home/pi/.bashrc
tail ~/.bashrc last 2 line for terminal check
~/.bashrc content
...
# add anpp(https://github.com/ZengjfOS/anpp) function to bash env
source ~/.androiddir.shsource ~/.bashrc四、cleanmake cleanrm ~/.androiddir.sh
sed -i "/.androiddir.sh/d" ~/.bashrc
sed -i "/ZengjfOS\/anpp/d" ~/.bashrc五、anpp使用方法5.1 自动补全使用anpp <tab><tab>a00 l00 m0 m8list projectanpp m0 <tab><tab>android bs1 bs2 dts kernel outlist componentm0 <tab><tab>android bs1 bs2 dts kernel outlist component5.2 项目源代码跳转projects中的名字去除-project后缀,小写名字可以直接跳转到对应的目录譬如M0-project,去除名字为M0,小写为m0,所以直接在终端输入m0,可以直接调转到其源代码根目录5.3 其他跳转命令NO.命令名说明1android跳转到当前project的根目录2bs1跳转到当前project的bootloader第一阶段目录3bs2跳转到当前project的bootloader第二阶段目录4dts跳转到当前project的设备树目录5kernel跳转到当前project的内核目录6out跳转到当前project的out目录7efuse跳转到当前project的签名工具目录六、自定义命令以上的命令都是相对通用的命令,如果需要自定义其他的命令,在custom.sh中进行处理project_product_custom()会被传入完整的项目参数,以供所有的数据处理,参数顺序参考config.json中的project_keys数组顺序自定义命令依赖project名字调用,例如:m0 test命令,调用M0-project的test自定义功能。本质是调用custom.sh中project_product_custom(),需要自行完成针对参数判断处理支持anppc(android project product custom)直接调用project_product_custom()函数处理七、自定义别名config.json中的alias字段用于自定义shell alias
|
anprx
|
ANPRxis a package for traffic analytics using networks of automatic number plate cameras.
|
anpu
|
Anpu (暗譜) - memorize or play a song from memory.A small library to search Spotify music.python -m pip install anpuFeaturesCleans up Spotify Links into API calls (tracks, albums and playlists only).Query search.Both of these are handled by a single function.RequirementsrequestsConfigAnpu requires the use of a config file to store the Access Token. The config file can also be used to store your App's credentials.It is automatically created in these directories respectively:GNU/Linux:HOME/.config/anpu/config.jsonmacOS:HOME/Library/Preferences/anpu/config.jsonWindows:%APPDATA%/anpu/config.jsonExampleimportanpuclient=anpu.client()# alternativelyclient=anpu.client(id="app_id",secret="app_secret")# search queryprint(client.send_request({"q":"very intresting query","type":"track","limit":5}))# get by linkprint(client.send_request("https://open.spotify.com/track/veryrealtrackid"))
|
anpwn
|
No description available on PyPI.
|
anpy
|
ANpy: Scrape painlessly Assemblée Nationale websiteANpy is a python library for easily scraping data fromhttp://assemblee-nationale.frwebsiteForget the ugly html, just get data:>>> from anpy.dossier import Dossier
>>> url = 'http://www.assemblee-nationale.fr/14/dossiers/republique_numerique.asp'
>>> dossier = Dossier.download_and_build(url)
>>> dossier.title
'Economie : pour une République numérique'
>>> dossier.legislature
14
>>> r.procedure
'PPL'
>>> r.senat_url
'http://www.senat.fr/dossier-legislatif/pjl15-325.html'
>>> r.steps
[{'type': 'AN_PREMIERE_LECTURE', 'acts': [...]}]Supported FeaturesANpy currently provides the following features:Amendement parsingAmendement searchQuestion parsingQuestion searchDossier parsing (two differents formats)Scrutin parsingANpy supports Python 3.5.Install :pipinstallanpyDocumentationDocumentation is available athttp://anpy.readthedocs.io/en/latestCLIA script anpy-cli is installed with the package, it provides the following commands :Show an amendement given its urlanpy-clishow_amendementhttp://www.assemblee-nationale.fr/14/amendements/1847/CION-DVP/CD266.aspShow amendements summaries after a given dateanpy-clishow_amendements_summary--start-date2014-06-01Print amendements order for a given id_dossier and id_examenanpy-clishow_amendements_order33299--id-examen4073Show a questionanpy-clishow_questionhttp://questions.assemblee-nationale.fr/q14/14-73499QE.htmShow a law project (dossier législatif)Format is likesenapyand the Open Data oflafabriquedelaloi.frThere's more work done on this parser to make it work across many casesanpy-cliparsehttp://www.assemblee-nationale.fr/14/dossiers/sante.asp[{"assemblee_id":"14-sante","assemblee_legislature":14,"assemblee_slug":"sante","beginning":"2014-10-15","long_title":"Questions sociales et santé : modernisation de notre système de santé","steps":[{"date":"2014-10-15","institution":"assemblee","source_url":"http://www.assemblee-nationale.fr/14/projets/pl2302.asp","stage":"1ère lecture","step":"depot"},{"date":"2015-03-20","institution":"assemblee","source_url":"http://www.assemblee-nationale.fr/14/ta-commission/r2673-a0.asp","stage":"1ère lecture","step":"commission"},{"date":"2015-04-14","institution":"assemblee","source_url":"http://www.assemblee-nationale.fr/14/ta/ta0505.asp","stage":"1ère lecture","step":"hemicycle"},
...Features:Merging the law project across legislaturesParse from Open Data when available or fallback to scraping HTMLReturns an array of law projects since a page can contains many law projects (ex: organic + non-organic)You can also parse many of them by giving a list of urls:anpy-clidoslegs_urls|anpy-cliparse_manyan_doslegs/Show a law project (with a format is similar to the AN Open Data)This parser is still a work-in-progressanpy-clishow_dossierhttp://www.assemblee-nationale.fr/14/dossiers/sante.asp{"legislature":"14","procedure":"PJL","senat_url":"http://www.senat.fr/dossier-legislatif/pjl14-406.html","steps":[{"acts":[{"date":"2014-10-15T00:00:00","type":"DEPOT_INITIATIVE","url":"http://www.assemblee-nationale.fr/14/projets/pl2302.asp"},{"type":"ETUDE_IMPACT","url":"http://www.assemblee-nationale.fr/14/projets/pl2302-ei.asp"},{"date":"2015-03-16T00:00:00","type":"PROCEDURE_ACCELEREE"},{"date":"2015-03-20T00:00:00","type":"DEPOT_RAPPORT","url":"http://www.assemblee-nationale.fr/14/rapports/r2673.asp"},{"date":"2015-03-24T00:00:00","type":"TEXTE_COMMISSION","url":"http://www.assemblee-nationale.fr/14/ta-commission/r2673-a0.asp"},{"date":"2015-02-11T00:00:00","type":"DEPOT_RAPPORT","url":"http://www.assemblee-nationale.fr/14/rap-info/i2581.asp"},{...Find all the dossier urlsanpy-clidoslegs_urlsShow a scrutinanpy-clishow_scrutinhttp://www2.assemblee-nationale.fr/scrutins/detail/(legislature)/14/(num)/1212Running the testspipinstall-U-rtest_requirements.txt
pipinstall-e.
pycodestyle--exclude=tests,docs.
flake8--exclude=tests,docs.
py.test--cov=anpy
|
anpylar
|
A client-side Python framework for creating web applications.It eases development by providing a modular approach with integrated support
for components, supercharged DOM Nodes, scoped styling, a routing engine and
reactive programming and promises (Python promises)SitesWebsite:https://www.anpylar.comDocumentation:https://docs.anpylar.comCommunity:https://community.anpylar.comRepositoriesTheAnPyLarproject is broken down into different repositories:This repo contains the command line interface to manage projectsOther repositories:Framework:https://github.com/anpylar/anpylarDocumentation:https://github.com/anpylar/anpylar-docsTutorial and Samples:https://github.com/anpylar/anpylar-tutorialInstallationViapip:pip install anpylarAnd yes … now you have to read the docs.
|
anqa-cli
|
anqa-cli
|
anqa-core
|
anqa-core
|
anqa-db
|
anqa-db
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.