Saravanan666/pypi-org huggingface dataset:
Package: cryohub
cryohubcryohubis a library for reading and writing Cryo-ET data based on thecryotypesspecification.InstallationpipinstallcryohubUsagecryohubprovides granular I/O functions such asread_starandread_mrc, which will all return objects following thecryotypesspecification.fromcryohub.readingimportread_starposeset=read_star('/path/to/file.star')A higher level function calledreadadds some magic to the IO procedure, guessing file formats and returning a list ofcryotypes.fromcryohubimportreaddata=read('/path/to/file.star','/path/to/directotry/',lazy=False,name_regex=r'tomo_\d+')See the help for each function for more info.Similarly to theread_*functions,cryohubprovides a series ofwrite_*functions, and a magic higher levelwritefuntion.fromcryohubimportwritewrite([poseset1,poseset2],'particles.tbl')From the command linecryohubcan be used as a conversion tool between all available formats:cryohubconvertinput_file.staroutput_file.tblIf instead you just need to quickly inspect your data but want something more powerful than just reading text files or headers, this command will land you in an ipython shell with the loaded data collected in a list calleddata:cryohubviewpath/to/files/*/other/path/to/file.starprint(data[0])FeaturesCurrentlycryohubis capable of reading images in the following formats:.mrc(and the.mrcs,.st,.map,.recvariants)
=.tif(f)Dynamo.emEMAN2.hdfand particle data in the following formats:Relion.starDynamo.tblCryolo.cboxand.boxEMAN2.json[^1]Writer functions currently exist for:.mrcEMAN2.hdfDynamo.emRelion.starDynamo.tbl[^1]: EMAN2 uses the center of the tomogram as the origin for particle coordinates. This means that when opening a tomogram, you'll have to recenter the particles based on its dimensions. To do so automatically, you can use thecenter_on_tomoargument to provide thehdffile with the tomogram you want to use.Image dataWhen possible (and unless disabled), cryohub loads images lazily usingdask. The resulting objects can be treated as normal numpy array, except one needs to callarray.compute()to apply any pending operations and return the result.ContributingContributions are more than welcome! If there is a file format that you wish were supported in reading or writing, simply open an issue about it pointing to the specification. Alternatively, feel free to open a PR with your proposed implementation; you can look at the existing functions for inspiration.
Package: cryolo
SPHIRE-crYOLODeep learning particle picking procedure based on YOLOv2.
Please seeour websitefor more information.LicenseThe license information can be found here:EULA license of crYOLOPaperIf you use crYOLO, please citeWagner, T. et al. SPHIRE-crYOLO is a fast and accurate fully automated particle picker for cryo-EM. Communications Biology 2, (2019).https://doi.org/10.1038/s42003-019-0437-z
Package: cryo-qcheck
cryo_qcheckThis package is work in progess which contains programs that help in accessing quality of cryoEM 3D map reconstruction.The details of the program are publised in biorxiv, a preprint server for biology.Please follow the link to the paper. "https://www.biorxiv.org/content/10.1101/2022.12.31.521834v1"Changes will be made to the up comming versions and accompied with paper published in peer review journal.The "qcheck" package presently constitutes one program which evalutes phase values from the 3D cryoEM reconstructed map and calcuates two statistical parameter to judge the quality of the reconstruction.The "pc_sk" program helps in quantitatively assess the presence of non-particles in the reconstructed map.The program takes two input parameters to perform calculations, one is the cryo-EM map which can have both mrc or map extension and second parameter is the map's contour value.The contour value is used to create a mask and then perform the calcualation.After the calucaltion are done, the output numerical values are printed on the console and a graph is saved into the folder with the name of the map provided for calculation.Usage:
python pc_sk.py example.mrc contour_value
Package: cryo-sam
Cryo-SAM
Author: James Rodgers, Aditya Balu
Organization: Iowa State University - Department of Electrical and Computer Engineering
Email:jmsrdgrs@iastate.eduUses Sam for the detection of squares, holes, and particles in cryo-em.Usage:from cryo_sam import CsamModel checkpoint location, several types downloadable fromhttps://github.com/facebookresearch/segment-anything#model-checkpointstesting done with the below model and checkpoint information:model_name = "vit_h"
checkpoint = "sam_model/sam_vit_h_4b8939.pth" 
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")Example construction:
detector = Csam(model_name, checkpoint, device)Csam.hole_finder(numpy_image_array)
Parameter: numpy image array
Returns: list of square coordinates (x, y, w, h)
Csam.square_finder(numpy_image_array):
Parameter: numpy image array
Returns: list of square coordinates (x, y, w, h)Both of the above returns will need to be changed in the future since extra data
is to be returned be the exact nature of that isn't determined yet. It will probably return a class
containing the data in the near future.Csam.visualize_detections(image, image_scale_percent, box_prompts = None, point_prompts = None,
show_boxes = True, show_point_prompts = None, show_box_prompts, show_masks = True):
Parameters:
image: numpy image array, numpy array of points, numpy array of bounding box, bool, bool, bool
image_scale_percent: int representing scaled percent i.e 60 = 60% of original size
point_prompts: numpy array of points. [[x, y], [x, y], [x, y], ...]
box_prompts: numpy array of rectangle boxes [[x1, y1, x2, y2], [x1, y1, x2, y2], ...]
show_boxes: bool, show bounding boxes generated by the model
show_masks: bool, show masks generated by the model
show_point_prompts: bool, show point prompts sent to the model
show_box_prompts: bool, show bounding box prompts sent to the model
Returns: NoneExample usage:

test_image = np.load("/mnt/big_data_2/pncc/annotated_data/160002/box4_g11/data_031022/mmm_0.npy")
test_image = cv2.cvtColor(test_image, cv2.COLOR_BGR2RGB)

print(detector.hole_finder(test_image))
detector.visualize_detections(test_image, image_scale_percent, show_boxes=True)

image_scale_percent = 40

This function will display the image with the detections overlaid on top of it. It is currently not specialized to hole or square.
This will be changed in the future, this is mostly for testing purposes.
The image_scale_percent is the percent of the original image size that the image will be displayed at. 
This is useful for large images that would be too large to display on a screen and to improve render speed. 
The default is 50% of the original size. Will probably add a save image option in the future.
Package: cryosparc-tools
cryosparc-toolsToolkit for interfacing with CryoSPARC. Read the documentation attools.cryosparc.comDevelopmentPrerequisitesGit and Git LFSPython >= 3.7Miniconda3C compiler such as GCC or ClangSet UpClone this repositorygitclone--recursivehttps://github.com/cryoem-uoft/cryosparc-tools.gitcdcryosparc-tools
gitlfspull(Optional) Create and activate a virtual environmentpython3-mvenv.venvsource.venv/bin/activate# macOS / Linux# OR.venv\Scripts\activate.bat# WindowsInstall dev dependencies and build native modulespipinstall-Upipwheel
pipinstall-e".[dev]"Install pre-commit hookspre-commit installRe-compile native moduleRecompile native modules after making changes to C code:python-msetupbuild_ext-iBuild Packages for PublishingInstall build dependenciespipinstall-e".[build]"Run the buildpython-mbuildPackages for the current architecture and python version are added to thedist/directory.Build DocumentationDocumentation is located in thedocsdirectory and is powered byJupyter Book.To build the docs, install build dependenciespipinstall-e".[build]"Then run Jupyter Bookjupyter-bookbuilddocsSite will be be built into thedocs/_build/htmldirectory.Note:Jupyter Book is not configured to re-run example notebooks upon build
since the notebooks require an active CryoSPARC instance to run.See theRun Example Notebookssection for instructions
on how to run the notebooks.Inline source documentation is compiled to HTML viaSphinxand usesGoogle Style Python docstrings.Run Example NotebooksThe Jupyter notebooks in the example documentation require additional
dependencies to execute, including the following system configuration:Nvidia GPU and driverMinicondainstalledCryoSPARC running atlocalhost:40000orcryoem0:40000(can aliascryoem0to localhost)Clean previous build artefacts:rm-rfcryosparc/*.sobuilddist*.egg-infoInstall dependencies into a new conda environment:condacreate-ncryosparc-tools-example-cconda-forge\python=3numpy==1.18.5\pyqt=5libtiffwxPython=4.1.1adwaita-icon-theme
condaactivatecryosparc-tools-example
pipinstall-Upip
pipinstallnvidia-pyindexmatplotlib~=3.4.0pandas==1.1.4notebook
pipinstall"cryolo[c11]"pipinstall-e".[build]"Run the notebook server with the following environment variables:CRYOSPARC_LICENSE_IDwith Structura-issued CryoSPARC licenseCRYOSPARC_EMAILwith a CryoSPARC user account emailCRYOSPARC_PASSWORDwith a CryoSPARC user account passwordYou may also need to includeLD_LIBRARY_PATHwhich includes the location of
CUDA Toolkit and cuDNN runtime libraries (e.g.,~/miniconda3/envs/tools/lib/python3.8/site-packages/nvidia/*/lib).CRYOSPARC_LICENSE_ID="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" \
CRYOSPARC_EMAIL="ali@example.com" \
CRYOSPARC_PASSWORD="password123" \
jupyter notebookFind examples indocs/examplesdirectoryLicensecryosparc-tools is licensed under the BSD-3-Clause license.
Package: crypko.py
Install usingpip install crypko.py.Provides a simple wrapper around the Crypko platform allowing users to
search for crypko, purchase crypko, fuse crypko, etc.More features are slowly being added as I work on them. If any part of
this stops working because the Crypko platform has been updated, let
me know and I’ll try and fix it.Basic usage:>>>importcrypko>>>api=crypko.API()>>>num,results=api.search(owner_addr='0xCa39E90CeC69838e73CC4F24Ec5077daC44B47d6',attributes='glasses')>>>num116>>>next(resuls)<crypko.objects.Crypkoobjectat0x7f01d9ded240>>>>print(next(results))Crypko#168993 SALE>>>c=next(results)>>>c.image'https://img.crypko.ai/daisy/9753747176b22ea4fdb120f308073c35930c38a6_lg.jpg'>>>c.details.matron<crypko.objects.Crypkoobjectat0x7f1d39348e10>>>>c.details.owner.username'Bottersnike'Examples:Examples can be found incrypko/examples.
Package: cryprum
Cryprum client, for Python 3Installationpip install cryprumUsageCreate a tokenhttps://cryprum.com/tokensand copy "Access key"fromcryprumimportClientcl=Client(token="<ACCESS_KEY>")fromcryprumimportAsyncClientcl=AsyncClient(token="<ACCESS_KEY>")Run testsCRYPRUM_TOKEN=<token> pytest -v tests.py
Package: crypt4gh
Crypt4GH Encryption Utilitycrypt4ghis a Python tool to encrypt, decrypt or re-encrypt files, according to theGA4GH encryption file format.InstallationPython3.6+required to use the crypt4gh encryption utility.Install it from PyPI:pip install crypt4ghor if you prefer the latest sources from Github:git clone https://github.com/EGA-archive/crypt4gh
pip install -r crypt4gh/requirements.txt
pip install ./crypt4ghorpip install git+https://github.com/EGA-archive/crypt4gh.gitUsageThe usual-hflag shows you the different options that the tool accepts.$crypt4gh-h

UtilityforthecryptographicGA4GHstandard,readingfromstdinandoutputtingtostdout.

Usage:{PROG}[-hv][--log<file>]encrypt[--sk<path>]--recipient_pk<path>[--recipient_pk<path>]...[--range<start-end>]{PROG}[-hv][--log<file>]decrypt[--sk<path>][--sender_pk<path>][--range<start-end>]{PROG}[-hv][--log<file>]rearrange[--sk<path>]--range<start-end>{PROG}[-hv][--log<file>]reencrypt[--sk<path>]--recipient_pk<path>[--recipient_pk<path>]...[--trim]Options:-h,--helpPrintsthishelpandexit-v,--versionPrintstheversionandexits--log<file>Pathtotheloggerfile(inYMLformat)--sk<keyfile>Curve25519-basedPrivatekey.Whenencrypting,ifneithertheprivatekeynorC4GH_SECRET_KEYarespecified,wegenerateanewkey--recipient_pk<path>Recipient's Curve25519-based Public key--sender_pk <path>     Peer'sCurve25519-basedPublickeytoverifyprovenance(akintosignature)--range<start-end>Byte-rangeeitheras<start-end>orjust<start>(Startincluded,Endexcluded)-t,--trimKeeponlyheaderpacketsthatyoucandecrypt


Environmentvariables:C4GH_LOGIfdefined,itwillbeusedasthedefaultloggerC4GH_SECRET_KEYIfdefined,itwillbeusedasthedefaultsecretkey(ie--sk${C4GH_SECRET_KEY})DemonstrationAlice and Bob generate both a pair of public/private keys.$crypt4gh-keygen--skalice.sec--pkalice.pub
$crypt4gh-keygen--skbob.sec--pkbob.pubBob encrypts a file for Alice:$crypt4ghencrypt--skbob.sec--recipient_pkalice.pub<file>file.c4ghAlice decrypts the encrypted file:$crypt4ghdecrypt--skalice.sec<file.c4ghFile FormatRefer to thespecificationsor thisdocumentation.
Package: crypt4ghfs
Crypt4GH File Systemcrypt4ghfs is a read-only fuse layer exposing Crypt4GH-encrypted files, as if they were decryptedcrypt4ghfs [-f|--foreground] [--conf conf_file] <mountpoint>The default configuration file is in~/.c4gh/fs.conf.Seethe configuration samplefor examples.seckeymust point to aCrypt4GH private keyor an ED25519 ssh key. This option is required.rootdirmust point to the root directory where the Crypt4GH-encrypted files reside. This option is required.whennotin read-only mode, a list of recipients must be specified (potentially only including yourself), for the case of an encrypting file system.By default, we daemonize the process. Use-f(or--foreground) to keep it in the foreground. This is useful to see the logs, sincestdout/stderrare otherwise redirected to/dev/nullwhen the process is daemonized.Extra debug output is available iflog_level=LEVELis used (whereLEVELis aPython logging levels)ExampleAssume you have Crypt4GH-encrypted files in~/encrypted-files, and your private key in~/.c4gh/mykey.
You can create a configuration file in~/.c4gh/fs.confwith[DEFAULT]
rootdir=~/encrypted-files
[CRYPT4GH]
seckey = ~/.c4gh/mykeyCreate an (empty) directory,~/clear-filesand mount the Crypt4GH file system in it with:crypt4ghfs ~/clear-filesYou can now read files in~/encrypted-filesas if they were decrypted.Instead ofcrypt4gh decrypt --sk ~/.c4gh/mykey < ~/encrypted-files/example.txt.c4gh | lessyou can now simply, usecat ~/clear-files/example.txt
# or any other tool using the POSIX file abstractionTips: if you mount sshfs from theEGA distribution system, you can download chunk-by-chunk
the files from the EGA, as Crypt4GH files, and useallof them with 2 commands:sshfs -o uid=$(id -u),gid=$(id -g) -f <remote-url>:. ~/encrypted-files, followed bycrypt4ghfs ~/clear-files. After that, you keep your prompt and can "use" the files inls -al ~/clear-files.InstallationThecodeis written in Python
(3.6+).libfuseandpyfuse3are required. To install
libfuse, you'll needcmake,mesonandninja.On Ubuntu, run:apt-get install ca-certificates pkg-config git gcc make automake autoconf libtool bzip2 zlib1g-dev libssl-dev libedit-dev ninja-build cmake udev libc6-dev
pip install -U pip
pip install meson pytestInstall the (latest) libfuse (v3.10) with:git clone https://github.com/libfuse/libfuse.git
cd libfuse
git checkout fuse-3.10.0
mkdir build
cd build
meson ..
ninja
ninja installFinally, install the python packages:pip install crypt4ghfs
# this will install crypt4gh, trio and pyfuse3 tooFor the (latest) SSHFS (v3.7), useful to test the above tips:git clone https://github.com/libfuse/sshfs.git
cd sshfs
git checkout sshfs-3.7.0
mkdir build
cd build
meson ..
ninja
ninja install
Package: cryptanalib3
cryptanalib3cryptanalib3is a Python3 fork of thecryptanalibmodule from the FeatherDuster project, meant to be a standalone module for performing cryptanalysis and cryptographic exploit development.Since Python3 forces a choice between bytes and string objects, cryptanalib3 now operates entirely on bytes objects in order to avoid the various ways in which Python manipulates strings to try to ensure the data is readable in the user's locale. All functions that consumed and return strings in the original Cryptanalib now receive and return bytes objects.UsageTo usecryptanalib3, launch Python3 andimport ca3. Since Python's built-inhelp()doesn't do a very good job of showing function prototypes with complex default values, there is ashow_help()function provided that addresses this shortcoming and functions more or less identically to the built-inhelp(). You can use this function to explore the functions provided by the module, like so:Cryptanalib3 can attempt to decode, identify, and look for indicators of vulnerability with theanalyze_ciphertext()function:Here is an example of generating ciphertext from a script that will give us a flag encrypted with AES-CTR using a fixed nonce, as well as encrypting any value we like using the fixed nonce. We first use theanalyze_ciphertext()function to determine that the ciphertext is generated with a stream cipher, and that there are signs that the key may be reused, indicated by thekey_reusekeyword returned by the analysis. This means we can launch a known plaintext attack against the ciphertext, calculating the keystream by XORing together any corresponding known plaintext and ciphertext. We encrypt a long string ofaaaa..., then XOR it with its encrypted version. We then XOR the keystream with the encrypted flag, decrypting it:
Package: cryptanalysis
Auto CryptanalysisThis project implements python module for automatic cryptanalysis of Substitution Permutation Network
ciphers by performing extensive linear and differential characteristic search and finding keybitsStructureThe project is structured as follows:Thecryptanalysisdirectory contains the main Python module for cryptanalysis.Thetestsdirectory contains unit tests for the moduleTheexamplesdirectory contains examples for using the moduleThedocsdirectory contains html documentation autogenerated from code doc-stringsInstallationPipThe project can be installed directly from pippipinstallcryptanalysisOtherwise clone and install is also viablegitclonehttps://github.com/deut-erium/auto-cryptanalysis.gitcdauto-cryptanalysis
pipinstall.RequirementsThis project requires Python3.6+ and the following Python packages:z3-solvertqdmRequirements are auto installed as a part of the installation process butYou can also install these packages using pip:pipinstall-rrequirements.txtUsageimportrandomimportcryptanalysissbox_size=6# bitspbox_size=sbox_size*16# 16 sboxesnum_rounds=4sbox=list(range(2**sbox_size))pbox=list(range(pbox_size))# random pbox and sboxrandom.shuffle(sbox)random.shuffle(pbox)random_key=random.randint(0,(2**pbox_size)-1)# random spn instance whose key is unknown to usspn=cryptanalysis.SPN(sbox,pbox,random_key,num_rounds)d_c=cryptanalysis.differential_cryptanalysis.DifferentialCryptanalysis(sbox,pbox,num_rounds+1)# override batch_encrypt with the oraclemax_num_encryptions=50000defbatch_encrypt(plaintexts):return[spn.encrypt(i)foriinplaintexts]d_c.batch_encrypt=batch_encryptdifferential_characteristics=d_c.characteristic_searcher.search_exclusive_masks()last_round_key_blocks=d_c.find_last_roundkey(differential_characteristics,max_num_encryptions//16)print("recovered last round key:",last_round_key_blocks)print("original last round key:",d_c.int_to_list(spn.round_keys[-1]))TestsYou can run the tests using the following command:python-munittestdiscoverDocumentationRead thedocumentationAutogenerated documentation from code doc-strings can be found underdocsContributingPlease feel free to submit pull requests or create issues if you find any bugs or have any suggestions for improvements.List of ideas to implement/TODO is present inCONTRIBUTING.mdLicenseThis project is licensed under the GPL License.
Package: cryptarchive
# CryptarchiveEncrypted network storage# Features
- standalone server
- client libraries for socket and twisted
- no cleartext usernames stored (usernames are stored hashed)
- auth-challenge makes password transfer to server unneccessary (challenge will be solved localy)
- filenames and directory sturcture are stored in an encrypted file.
- command line tool# Installation`sudo` may be required.From pypi:`bash pip install cryptarchive `From source:`bash git clonehttps://github.com/bennr01/cryptarchive.gitcd cryptarchive python setup.py install `# Server
To start the server, runcryptarchive-server <datadir>For more arguments, please seecryptarchive-server –help.# Client
To view help on the command-line client, seecryptarchive-client –help.
Package: cryptbase
Protect yourself and your customers with database encryption.Free software: MIT licenseInstallationpip install cryptbaseUsageYou can use cryptbase with django ORM or with SQLAlchemy.To use with SQLAlchemy:from cryptbase import EncryptedText
sensitive = Column(EncryptedText(key=DB_KEY))To use with django:from cryptbase import EncryptedTextField
sensitive = EncryptedTextField(key=DB_KEY)DB_KEY is 32 bytes encryption key as hex encoded string. Fields behave as TEXT fields, data are transparently encrypted
when storing into the database and decrypted on retrieval.DevelopmentTo run all the tests run:toxChangelog1.0.0 (2021-10-17)Encrypted text field for Django and SQLAlchemy with AES-256-CTR
Package: cryptbuddy
CryptBuddy~~~~~~~~~~An over-engineered CLI program to perform multithreaded encryption/decryption.This was written as an investigatory project for CBSE class XII board exams.Whitepaper can be found at https://static.kush.in/projects/CryptBuddy.pdfInstall:pip3 install cryptbuddyThe CLI can be called using any of the commands 'cb', 'crypt', or 'cryptbuddy'Usage: cb [OPTIONS] COMMAND [ARGS]...A CLI tool for encryption and decryption╭─ Options ──────────────────────────────────────────────────────────────────────╮│ --version             -v                                                       ││ --install-completion            Install completion for the current shell.      ││ --show-completion               Show completion for the current shell, to copy ││                                 it or customize the installation.              ││ --help                -h        Show this message and exit.                    │╰────────────────────────────────────────────────────────────────────────────────╯╭─ Commands ─────────────────────────────────────────────────────────────────────╮│ decrypt     Decrypt file(s) symmetrically using a password or asymmetrically   ││             using your private key                                             ││ encrypt     Encrypt file(s) using a password or public keys of one or more     ││             users from your keychain                                           ││ export      Export your public key file to specified directory to share with   ││             others                                                             ││ init        Initialize cryptbuddy by generating a key-pair and creating the    ││             keychain database                                                  ││ keychain    Manage your keychain                                               ││ shred       Shred file(s) or directories                                       │╰────────────────────────────────────────────────────────────────────────────────╯