Saravanan666/pypi-org huggingface dataset:
Package: py-cryptonight
Python binding for Monero hash functionscn_fast_hash,cn_slow_hash.cn_fast_hashis used mainly for hashing to scalars / EC points.cn_slow_hashis CryptoNight hash function used for mining and
encryption key derivation for encrypted wallet files.Supports CNv1, CNv2, CNv4JIT tested on OSX + LLVM, experimentalPy2, Py3 compatible + tests with Monero test vectors.pip install py-cryptonightUsageimportbinasciiimportpycryptonightpycryptonight.cn_fast_hash(b'1')# hexcoded: b'c89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6pycryptonight.cn_slow_hash(b'1')# hexcoded: b'cbdfba46388e040422b4a9daa471726be659ae184ee86420c2795647f0b301d5# variant 1:pycryptonight.cn_slow_hash(binascii.unhexlify(b'38274c97c45a172cfc97679870422e3a1ab0784960c60514d816271415c306ee3a3ed1a77e31f6a885c3cb'),1)# variant 1# hexcoded: b'ed082e49dbd5bbe34a3726a0d1dad981146062b39d36d62c71eb1ed8ab49459b# variant 2:pycryptonight.cn_slow_hash(b'1',2)# variant 2# hexcoded: b'44016d2376838d89b374e99a20118c0e8916e8c0a5b910744efc7d8f426509ca# variant 4:pycryptonight.cn_slow_hash(b'1',4)# variant 4# hexcoded: b'97db7e03629f7c17e4d78b36a2d247d226b88a8df6cf69f2e4cdae1f1b706b4a# variant 4, height:pycryptonight.cn_slow_hash(b'1',4,prehashed=0,height=1)# variant 4, height 1# hexcoded: b'09bcf4997132dc3d7980125620724acc9c90dc393cb6694097a7d745c57b6b5bBuild problemsThe extension builds with AES extension by default. To disable this,
rebuild with:MONERO_NO_AES=1pythonsetup.pyinstallJITThe JIT optimization is disabled by default as the implementation was
not properly tested. If you want to experiment with JIT you need to
compile with:MONERO_NO_JIT=0pythonsetup.pyinstallMONERO_USE_CNV4_JIT=1./test.shTo rebuild locally and test:MONERO_NO_AES=0MONERO_NO_JIT=0pythonsetup.pydevelopMONERO_USE_CNV4_JIT=0./test.sh# JIT disabledMONERO_USE_CNV4_JIT=1./test.sh# JIT enabledFor more info readJIT.mdDonationsThanks for your support!86SgqL4YwtWBgq65CitxbPC5ChUJrDkTVWJgtenuf6S68GTLWqPh3zydYpoFhr8JyVdWEZmoMMnhjdvoKQ9urZFfCXKmD93
Package: pycryptopan
PyCrypto-PAnA IP address anonymizer in Python using theCrypto-PAnalgorithm.Based onIP::Anonymousby John Kristoffrequirements:pycryptopip install pycryptoinstallation:python setup.py installusage:from cryptopan import CryptoPan

c=CryptoPan("".join([chr(x) for x in range(0,32)]))

c.anonymize("192.0.2.0")AcknowledgementsThis work was funded by the EU FP7 ProjectCONFINE
Package: pyCryptoPayAPI
pyCryptoPayAPISimple Python implementation ofCrypto Pay API(Crypto Pay is a payment system based on@CryptoBot)InstallationInstallation using pip (a Python package manager):$ pip install pyCryptoPayAPIUsageEverything is as simple as theAPIitself.Create pyCryptoPayAPI instanceAccess API methods in pythonic notation (getInvoices -> get_invoices)from pyCryptoPayAPI import pyCryptoPayAPI
client = pyCryptoPayAPI(api_token="zzz")
print(client.get_balance())You can also check tests.py.ExceptionsExceptions are rised using pyCryptoPayException class.
Package: pycryptoprosdk
Библиотека для работы с Cryptopro CSP в pythonУстановкаУстановить КриптоПро CSP.Установить пакеты lsb-cprocsp-devel-.noarch.rpm и cprocsp-pki-amd64-cades.rpm из состава КриптоПро ЭЦП SDK.При необходимости, создать симлинк:ln-s/opt/cprocsp/lib/amd64/libcades.so.2.0.0/opt/cprocsp/lib/amd64/libcades.soПример установки пакетов можно посмотреть вpycryptoprosdk/compose/Dockerfile.Установить pycryptoprosdk:pipinstallpycryptoprosdkПримеры использования>>>frompycryptoprosdkimportCryptoProSDK>>>sdk=CryptoProSDK()# Создание и проверка отсоединенной подписи:>>>content='test content'>>>cert=sdk.get_cert_by_subject('MY','Ivan')>>>signature=sdk.sign(content,cert.thumbprint,'MY',detached=True)>>>result=sdk.verify_detached(content,signature)# статус проверки:>>>result.verification_status0# 0: Успешная проверка подписи.# 1: Отсутствуют или имеют неправильный формат атрибуты со ссылками и значениями доказательств подлинности.# 2: Сертификат, на ключе которого было подписано сообщение, не найден.# 3: В сообщении не найден действительный штамп времени на подпись.# 4: Значения ссылок на доказательства подлинности и сами доказательства, вложенные в сообщение, не соответствуют друг другу.# 5: Не удалось построить цепочку для сертификата, на ключе которого подписано сообщение.# 6: Ошибка проверки конечного сертификата на отзыв.# 7: Ошибка проверки сертификата цепочки на отзыв.# 8: Сообщение содержит неверную подпись.# 9: В сообщении не найден действительный штамп времени на доказательства подлинности подписи.# 10: Значение подписанного атрибута content-type не совпадает со значением, указанным в поле encapContentInfo.eContentType.# сертификат подписанта:>>>result.cert.as_dict(){'CN':'Ivan'}# создание хэша файла алгоритмом ГОСТ Р 34.11-94:>>>sdk.create_hash('some text',alg='CALG_GR3411')'046255290b0eb1cdd1797d9ab8c81f699e3687f3'# поиск сертификата в хранилище MY по отпечатку:>>>cert=sdk.get_cert_by_thumbprint('MY','046255290b0eb1cdd1797d9ab8c81f699e3687f3')# поиск сертификата по имени:>>>cert=sdk.get_cert_by_subject('MY','CRYPTO-PRO Test Center 2')# установка сертификата в хранилище MY:>>>withopen('certificate.cer'),'rb')asf:>>>cert_content=f.read()>>>sdk.install_certificate('MY',cert_content)# удаление сертификата из хранилища MY по отпечатку:>>>sdk.delete_certificate('MY','9e78a331020e528c046ffd57704a21b7d2241cb3')# извлечение сертификата подписанта из подписи:>>>withopen('signature.sig','rb')asf:>>>signature_content=f.read()>>>cert=sdk.get_signer_cert_from_signature(signature_content)
Package: pycryptostring
pycryptostringA text format for easily interacting with cryptographic hashes and keysDescriptionOne of the many challenges with working with encryption is that keys and hashes are arbitrary-looking binary blobs of data -- they have zero meaning to people just looking at them. They also lack context or any other descriptive information; a 256-bit BLAKE2B hash looks the same as a SHA256 hash, but Heaven help you if you get something mixed up.The solution is to represent keys and hashes as text and pair an algorithm nametag with the text representation of the key or hash. For example, a sample 128-bit BLAKE2B hash in its binary form is represented in hex asa6 30 2a b0 da ef 14 fb 9b 82 b9 69 3e 78 76 6b. Without spaces, this is 32 characters. The same hash can be represented in CryptoString format asBLAKE2B-128:rZ6h7+V2$mn}WG%K6rL(.The format consists of the prefix, a colon for the separator, and the Base85-encoded binary data. Base85 was chosen because of its higher efficiency and source. The prefix consists of up to 24 characters, which may be capital ASCII letters, numbers, or dashes. A colon is used to separate the prefix from the encoded data.The official prefixes as of this writing are:ED25519CURVE25519AES-128 / AES-256 / AES-384 / AES-512SALSA20 / XSALSA20SHA-256 / SHA-384 / SHA-512SHA3-256 / SHA3-384 / SHA3-512BLAKE2B-128 / BLAKE2B-256 / BLAKE2B-512BLAKE3-128 / BLAKE3-256 / BLAKE3-512StatusThe module is production stable and in active use in combination with PyNaCl.UsageRegular usage of a CryptoString mostly involves creating an instance from other data. The constructor can take a CryptoString-formatted string or a string prefix and some raw bytes. Once data has been put into the instance, getting it back out is just a matter of casting to a string, or callingas_string(),as_bytes(), oras_raw(). The last of these three methods only returns the raw data stored in the object.frompycryptostringimportCryptoString,encode85key=nacl.public.PrivateKey.generate()my_public_key=CryptoString('CURVE25519',key.public_key.encode())my_private_key=CryptoString('CURVE25519',key.encode())print(f"My new public key is{my_public_key}")The methodsset(),set_raw(), andis_valid()are also useful. The module also comes with a bare functionis_cryptostring()which returns True if a string passed to it is CryptoString-formatted.BuildingThis is a very simple module. Most people will just want to install it from pip. Extracting the tarball and runningpython setup.py installwill get you going otherwise.
Package: py-cryptotp
py_cryptotppy_cryptotp is a package that let's you generate and handle OTP or 2 step verifications easily and securely without using any DATABASES.It's a very common practice to use databases while handling otp verifications; primarily to storing and later retrieving it to match with user input. But this shouldn't be the way of handling it. Otp is just a temporary data which doesn't belong to the database. Not to mention database operations are comparatively slow and costly.py_cryptotp eliminates this problem by using cryptography underneath.This package simply uses the built-in python hashlib and hmac module and doesn't rely on any other dependencies.Installation and Usage$pipinstallpy-cryptotpOnce the installation is done import py_cryptotp and create a new object:frompy_cryptotpimportCryptotpotp_handler=Cryptotp(key='YourSecretKeyHere')# keep this secret key secureThen use thegeneratemethod to generate a new otp. Hereotp_lengthis the length of the otp andotp_durationis the expiration time of the otp inminutesraw_otp,hashed_otp=otp_handler.generate(otp_length=6,otp_duration=2)# raw_otp - 123456# hashed_otp - a45256bbeb6d90aad762ce9552e458064aa85054a.1611669734It will return theraw_otpandhashed_otp. Send theraw_otpto user via SMS, Email or anyway you choose and send thehashed_otpto the client. If your client isReactorVueyou can just store it in a state variable. Or you can also useLocal Storage,Session Storageetc to store it. As it's completely hashed and irreversible it doesn't matter where you're storing it.Then when the user gets the otp and enters it to client send back thehashed_otpwith the user given otp and use thevalidatemethod:ifotp_handler.validate(user_give_otp,hashed_otp):# do further operations accordinglyThevalidatemethod gives back abooleanvalue. If the user given otp is correct and expiration time is in future it returnsTrueotherwiseFalseHere's asample django rest framework applicationthat demonstrate the whole package properly.
Package: pycryptotransactions
py-Crypto-TransactionsA python package to query crypto transaction from various blockchains and exchanges
to build your own portfolio app!pyCryptoTransactions also supports a few exporters, such that data can be imported e.g. at Koinly or Accointing.Note: Very elary alpha version!InstallUse pip:pip install pyCryptoTransactions (NOTE: make sure to use camelCase name like this and not pycryptotransactions)
Or use poetry
Or install directly by cloning the git repoSupported BlockchainsBitcoinLitecoinCosmosThorchainOsmosIotaPersistenceEthereum (soon)Bsc (soon)Supported exchangesBinance (support for exported CSVs, no API yet)Coinbase (Oauth Api)Coinbase Pro (soon)Examplest = LitecoinImport("xpub...")
t.getTransactions()`t = CosmosChain("cosmos....")
txs = t.getTransactions()
print(txs)
df = txs.toPandasDataframe()
df.to_csv("atom_test.csv")
print(txs.calculateBalance())
a = AccointingExporter(txs)
a.exportToExcel("atom_accointing.xlsx")
Package: py-cryptowatch-client
Cryptowatch APIwrapperCryptowatch Doc:https://docs.cryptowat.ch/rest-api/Installpipinstallpy-cryptowatch-clientUsagefromcryptowatchimportCryptowatchcw=Cryptowatch(key=None)cw.get_market_prices()Testingvirtualenvvenvsource./venv/bin/activate
pipinstall-rdev_requirements.txt
deactivatesource./venv/bin/activate
pytest
Package: pycs
Python Configuration SystemDescriptionLibrary to define configurations using python files.InstallationRecommended installation with pip:pipinstallpycsUsageDefine config schema:# project/config.pyfrompycsimportCL,CNclassBaseClass:passschema=CN()# Basic config nodeschema.DICT=CN()# Nested config nodeschema.DICT.FOO="FOO"# Config leaf with actual valueschema.DICT.INT=1schema.NAME=CL(None,str,required=True)# Specification of config leaf to be defined with typeschema.CLASSES=CN(BaseClass)# Config node with type specification of its config leavesschema.SUBCLASSES=CN(CL(None,BaseClass,subclass=True))# Config node with subclass specification of its config leavesschema.VAL=CL(1,desc="Interesting description")# Config leaf with descriptiondeftransform(cfg:CN)->None:cfg.NAME=cfg.NAMEor"__static__"cfg.DICT.FOO="BAR"defvalidate(cfg:CN)->None:assertlen(cfg.NAME)>0defhook(cfg:CN)->None:print("Loaded")# Add transform, validation & hooks function# Transforms are run after config is loaded and can change values in configschema.add_transform(transform)# Validators are run after transforms and freeze, with them you can verify additional restrictionsschema.add_validator(validate)# Hooks are run after validators and can perform additional actions outside of configschema.add_hook(hook)# Validators and hooks should not (and mostly cannot) modify the configIf you want to use configuration with default values or make changes in the program you can use.static_init():fromproject.configimportschemacfg=schema.static_init()# 'Loaded'print(cfg.DICT.FOO)# 'BAR'If you want to store changes more permanently, please create a config file:# my_cfg.pyfrompycsimportCNfromproject.configimportschema# Use init_cfg() to separate changes from base variable and freeze schemacfg=schema.init_cfg()# Schema changes are not allowed here, only leaves can be altered.cfg.NAME="Hello World!"cfg.DICT.INT=2You can also create another file to inherit from first and add more changes:# my_cfg2.pyfromntcimportCNfrom.my_cfgimportcfg# Separate changes from parent, important when inheriting in multiple filescfg=cfg.clone()cfg.DICT.FOO="BAR"There a few restrictions on imports in configs:If you are inheriting changes from another config, please import variable ascfgNo other import should be namedcfgLoad actual config and use it in the code.# main.pyfrompycsimportCNcfg=CN.load("my_cfg.py")# Access values as attributesassertcfg.NAME=="Hello World!"assertcfg.DICT.FOO=="BAR"DevelopmentInstall dev dependencies:pip install -e ".[dev]"For linting and basic fixesruffis used:ruff check . --fixThis repository follows strict formatting style which will be checked by the CI.
To properly format the code, use theblackformat:black .To test code, usepytest:pytest .This repository follows semantic-release, which means all commit messages have to follow astyle.
You can use tools likecommitizento write your commits.AcknowledgementsThis library was inspired byyacs.
Package: pycsa
Homepage:github.com/structurely/csa.Coupled simulated annealing (CSA) is a generalization of simulated annealing (SA),
which is an optimization algorithm that doesn’t use any information about the derivates
of a function. The original paper describing CSA can be found here:ftp://ftp.esat.kuleuven.be/sista/sdesouza/papers/CSA2009accepted.pdfEssentially, CSA is like multiple simulated annealing (i.e.mindependent SA processes run in parallel), except that the acceptance
probability at each step is calculated as a function of the current
state acrossallmprocesses. For a more complete description of
the general CSA algorithm, seeDescription of CSA.InstallationUsingpip:pip install pycsaDirectly fromGitHub:pip install git+https://github.com/structurely/csa.gitUsageSeeexamples/travelling_salesman.ipynbfor an example of CSA applied to thetravelling salesman problem
(TSP).ContributingFeel free to submit issues atgithub.com/structurely/csa/issuesand pull requests to the dev branch:github.com/structurely/csa/tree/dev.LicenseSeeLICENSE.txt.Relatedperrygeo/simanneal: a
Python implementation of (single) simulated annealing.docs.scipy.org:
the SciPy implementation of simulated annealing.
Package: pyCSalgos
Python implementation of various Compressed Sensing algorithms, some of them originally implemented in Matlab.
Algorithms implemented:
- l1 minimization from l1magic
- Orthogonal Matching Pursuit
- Smoothed L0
- Greedy Analysis Pursuit
- NESTA
- Two Stage Thresholding
- Analysis-By-Synthesis (my paper)Not thoroughly tested, but I use them for my research. Use at own risk.The code can also be forked or downloaded fromhttps://github.com/nikcleju/pyCSalgos
Package: pycsbinarywriter
pyCSBinaryWriterA simple library for .NET binary (de)serialization.This package gives developers access to simple method calls from decoding
binary data written by .NET BinaryWriter.LimitationsDecimal is not implemented yet. Pull requests are welcome.asyncio support is brand new and may be buggy.Installation$pipinstall-UpycsbinarywriterUsagefrompycsbinarywriterimportcstypes# Decode .NET 7-bit-prefixed stringassert'abc123'==cstypes.string.unpack(b'\x06\x61\x62\x63\x31\x32\x33')# Decode .NET uint8 (ubyte)assert127==cstypes.uint8.unpack(b'\x7f')# Encode .NET int16assertb'\x2e\xfb'==cstypes.int16.pack(-1234)LicenseMIT License
Package: pycscl
PyCSCL 0.2.0TheCuteSATConstraint encoderLibrary for Python 3PyCSCL is a collection of propositional logic constraint encoders. You can use it
e.g. to reduce instances ofNP-complete problemsto instances
of theBoolean satisifability (SAT) problem,
benefitting from the availability of powerful off-the-shelf SAT
solvers.Though PyCSCL is designed not to depend on a specific SAT solver interface,
it contains a simple and easy-to-use binding for
SAT solvers implementing theIPASIRinterface.The versioning scheme of PyCSCL isSemantic Versioning 2.0.0.Installing PyCSCLPrerequisitesPyCSCL has no dependencies beyond Python 3.7.Release packagesPyCSCL releases are distributed on thePython Package Index.
To be consistent with package naming conventions, the PyCSCL package is namedpycscl.
To install the latest PyCSCL release package, you can simply usepip:python3 -m pip install pycsclCustom packagesAlternatively, you can check out this repository and install PyCSCL
by creating a package yourself. Navigate to the PyCSCL directory and issue the commandpython3 setup.py sdistThis will create a packagepycscl-<Version>.tar.gzfile in the
directorydist. Now, you can install your custom PyCSCL package
by runningpython3 -m pip install <PathToPyCSCL>/dist/pycscl-<Version>.tar.gzDocumentationPyCSCLtutorialExamplespydocEncodersCardinality (at-most-k) constraint encodersBinomial encodingLTSeq encodingCommander encodingPackage:cscl.cardinality_constraint_encodersGate constraint encodersAND, OR, binary XOR gatesBinary MUX gatesHalf adder and full adder gatesPackage:cscl.basic_gate_encodersBitvector constraint encodersBitvector AND, OR, XOR gatesRipple-carry bitvector adder and (2's complement) subtractor gatesParallel bitvector multiplier gateUnsigned bitvector divider and modulo gateSigned (2's complement) and unsigned bitvector comparison gatesPackage:cscl.bitvector_gate_encodersExamplescscl_examples.factorization:integer factorizationproblem encodercscl_examples.sudoku: SAT-basedSudokusolvercscl_examples.smt_qfbv_solver(under construction): simple QF_BVSMTsolver
Package: pycsg
pycsgPython port of Evan Wallace’s [csg.js](https://github.com/evanw/csg.js/)Constructive Solid Geometry (CSG) is a modeling technique that uses Boolean
operations like union and intersection to combine 3D solids. This library
implements CSG operations on meshes elegantly and concisely using BSP trees,
and is meant to serve as an easily understandable implementation of the
algorithm. All edge cases involving overlapping coplanar polygons in both
solids are correctly handled.![alt tag](http://content.screencast.com/users/TimKnip/folders/Jing/media/c1ad71ef-5032-4733-a210-2f97ae7b03cc/2015-07-24_2013.png)examples$ python examples/pyopengldepends on:
PyOpenGL
PyOpenGL_accelerate
Package: pycsgogpt
pycsgogptpycsgogptis a CSGO chatbot powered by OpenAI GPT-3.5 Turbo. It connects to a CSGO client via Telnet and uses the GPT-3.5 Turbo model to generate responses based on incoming messages from other players. The chatbot provides an interactive and fun experience by simulating human-like conversations in the game.InstallationpipinstallpycsgogptUsageFirst, add-netconport 21234to the launch options of your CSGO server. Then, start the server and run the following command:pycsgogpt<your_player_name><your_openai_api_key>[--telnet-port<telnet_port>]player-name: Your CSGO player name.openapi-key: Your OpenAI API key.telnet-port (optional): The telnet port for the CSGO server (default: 21234).ContributingContributions are welcome! If you have any bug reports, feature requests, or suggestions, please open an issue or submit a pull request.LicenseThis project is licensed under the MIT License. SeeLICENSEfor more details.
Package: pycsi
PythonPackageMetapycsipycsi is a simple python library to validate data and/or build a validation schema.InstallationpipinstallpycsiUsageWe might begin by creating validation callables such:defis_divisible_by_three(x:float):returnx%3==0defis_all_positive(numbers:list[float]):returnall(number>0fornumberinnumbers)defis_quotient_positive(x:float,y:float):returnx/y>0Then we can instantiate aSubvalidatorinstance and  the validation callables to it:frompycsiimportSubvalidatorfirst_subvalidator=Subvalidator("First condition","Number is not divisible by 3",is_divisible_by_three,x=3)second_subvalidator=Subvalidator("Second condition","Not every number is positive",is_all_positive,numbers=[1,2,3,4,5,6,7,8,9,-10],)third_subvalidator=Subvalidator("Third condition","Quotient is not positive",is_quotient_positive,x=10,y=2,)Finally we can create a validator object and add the subvalidators to it.frompycsiimportValidatorvalidator=Validator()validator.add(first_subvalidator)validator.add(second_subvalidator)validator.add(third_subvalidator)validator.run()The validator will run all the subvalidators and theunvalidated_setproperty will return a set of the failed subvalidators.print(validator.unvalidated_set){ValidatorError(condition='Second condition',error_message='Not every number is positive')}Asynchronous UsageThis library also supports async validation. We can create asyncronous validation callables such:importasyncioasyncdefasync_is_divisible_by_three(x:float)->bool:awaitasyncio.sleep(0.1)returnis_divisible_by_three(x)asyncdefasync_is_all_positive(numbers:list[float])->bool:awaitasyncio.sleep(0.1)returnis_all_positive(numbers)Instead of using theSubvalidatorAPI, we are going to use theAsyncSubvalidatorin the next step:frompycsiimportAsyncSubvalidatorfirst_subvalidator=AsyncSubvalidator("First condition","Number is not divisible by 3",async_is_divisible_by_three,x=10,)second_subvalidator=AsyncSubvalidator("Second condition","Not every number is positive",async_is_all_positive,numbers=[1,2,3,4,5,6,7,8,9,10],)Same for theValidatorAPI, we will switch the theAsyncValidator.frompycsiimportAsyncValidatorvalidator=AsyncValidator()validator.add(first_subvalidator)validator.add(second_subvalidator)validator.run()print(validator.unvalidated_set){ValidatorError(condition='First condition',error_message='Number is not divisible by 3')}
Package: pycsk
PyCskClear Sky Charts in your terminalThis is a program to pull stargazing conditions fromClear Sky Charts.The colors will change according to when is the best stargazing forecast. For example, red will indicate that conditions are not great for that particular day, while green indicates that it will be a good day. For more information on which each sections means, seehere.Requirements:python3(>= 3.6)appdirs(>= 1.4.3)sty(>= 1.0.0b9)Installation$ pip3 install pycskUsage$ cskTo search for cities by states:$ csk --search-by-stateTo search for a specific city:$ csk --search-by-city