package
stringlengths
1
122
pacakge-description
stringlengths
0
1.3M
acme-bleach
BleachRemove unsightly visible characters from your code. Inspired by theAcme::BleachPerl moduleby Damian Conway.InstallationYou can installBleachviapipfromPyPI:$pipinstallacme-bleachUsageLet's start with the following Python script,hello.py:print("Hello, world!")BleachingTo bleach it, run the following command:$bleachbleachhello.py-ohello-bleached.pyThe result is a bleached version of the original script. The contents ofhello-bleached.pyare (representing tabs with»»»»and spaces with·):# coding=bleach »»»»···»»»»»»»»»»»»»»»»»···»»»»»·»»»»»»»··»»·»»»»»»»·»»»··»»···»»»»»···»·»»»»»»» »»»»»»»»·»»»·»»»»»»»»»»»»»»»»»»»·»»»»»»»»»»»·»»»»»»»·»»»»»»»·»»»»»»»»»»»»»»»··»»»»»»·»»»·»»»··»»··»»»»»» »»»»··»»··»»»»»»»»»»··»»····»»»»»»»»·»»»··»»»»»»»»»»»»»»·»»»»»»»»»»»»»»»»»»»»»»»···»··· »»»»··»»····»»»»···»»»»»·»»»»»»»··»»··»»»»»»»»»»··»»»»»»·»»»»»»»»»»»»»»»·»»»»»»»»»»»»»»»· »»»»»»»»·»»»»»»»»»»»·»»»»»»»»»»»·»»»·»»»»»»»·»»»»»»»»»»»»»»»·»»»·»»»RunningYou can run the bleached file usingbleach run:$bleachrunhello-bleached.pyHello, world!UnbleachingYou can unbleach the file usingbleach unbleach:$bleachunbleachhello-bleached.py-ohello-unbleached.py$cathello-unbleached.pyprint("Hello, world!")Installing the bleach codecRunning scripts withbleach runis far too much effort. If you want to run bleached scripts directly, you can install thebleachcodec:$bleachinstallWrote /home/stefans/bleach/.venv/lib/python3.10/site-packages/bleach.pth$pythonhello-bleached.pyHello, world!Installing the codec will attempt to write a.pthfile to thesite-packagesdirectory of the current Python interpreter. Note theimportin the.pthfile will be evaluated every time the current Python runs, so there is a tiny amount of overhead.LicenseDistributed under the terms of theMIT license,Bleachis free and open source software.CreditsThis project was generated from a variant of@cjolowicz'sHypermodern Python Cookiecuttertemplate.
acmebot
ACME protocol automatic certitificate manager.This tool acquires and maintains certificates from a certificate authority using the ACME protocol, similar to EFF’s Certbot. While developed and tested using Let’s Encrypt, the tool should work with any certificate authority using the ACME protocol.FeaturesThis tool is not intended as a replacement for Certbot and does not attempt to replicate all of Certbot’s functionality, notably it does not modify configuration files of other services, or provide a server to perform stand-alone domain validation. It does however, do a few things that Certbot does not, simplifying certificate management in more advanced environments. In addition to automatically issuing and maintaining certificates, the tool can also maintain associated HPKP headers and TLSA (DANE) records.Master/Follower ModeThis tool separates the authorization (domain validation) and certificate issuance processes allowing one machine to maintain authorizations (the master), while another machine issues certificates (the follower). This is useful for situations where an isolated server is providing a service, such as XMPP, behind a firewall and does not have the ability to perform authorizations over http or configure DNS records, but still needs to obtain and periodically renew one or more certificates.Sharing of Private Keys Between CertificatesThis tool allows multiple certificates to be defined using the same public/private key pair.When deploying Hypertext Puplic Key Pinning (HPKP), you can optionally use the same pins to secure subdomains. This increases security of the site because a visitor to a root domain will have previously obtained pins for subdomains, reducing the possibility of a man-in-the-middle attacker installing a false pin on first visit.This practice obviously requires the use of the same public/private key pair for the domain and all subdomains. However, it may not be desirable to use the same certificate for all subdomains, for example, exposing the full list of subdomains in the alternative names of the root domain’s certificate, or reissuing the root domain’s certificate every time a subdomain is added or removed.Hypertext Public Key Pin (HPKP) SupportThis tool automatically generates and maintains HPKP header information suitable to be directly included in server configuraton files. Support for Apache and Nginx are provided by default, other servers may be added by the user.Automatic Management of Backup Private KeysUsing HPKP requires a second public key to provide a backup when private keys are changed. This tool automatically generates backup keys and switches to the pre-generated backup key when rolling over private keys. Rolling over private keys can be done automatically and is scheduled independently of certificate expiration. Private key rollover is prevented in cases where insufficient time has passed to distribute backup HPKP pins.Parallel RSA and ECDSA CertificatesThis tool can generate both RSA and ECDSA certificates. By default it will generate and maintain both types of certificates in parallel.Certificate Transparency / Signed Certificate Timestamp SupportThis tool can automatically register your certificates with multiple certificate transparency logs and retrieve Signed Certificate Timestamps (SCTs) for each. The retrieved SCTs are suitable to be deilvered via a TLS extension, SCT TLS extension modules are available forApacheandNginx.OCSP Response File SupportThis tool automatically obtains and maintains OCSP response files for each configured certificate. These files may be used to serve stapled OCSP responses from your server without relying on the server’s OCSP stapling mechanisms. Some servers, such as Nginx, obtain stapled OCSP responses lazily and cache the response in memory. When using the OCSP Must-Staple extension this can result in your server being unreachable until the OCSP response is refreshed, during OCSP responder outages, this can be a significant interval. Using OCSP responses from disk will alleviate this issue. Only OCSP responses with a “good” status will be stored.Encrypted Private KeysPrimary and backup private keys can optionally be encrypted using a passphrase and cipher of your choice.Mixed Use of DNS and HTTP AuthorizationBy default this tool performs dns-01 authorizartions for domain validation. It is possible to configure overrides for specific domains names to use http-01 authorization instead. This is useful for situations where a domain outside your immediate control has provided an alias to your web site.Automatic Local or Remote DNS UpdatesThis tool can automatically add and remove DNS records for dns-01 authorizations as well as TLSA records. Updates to a local server can be made via an external zone file processor, such asbindtool, or to a remote DNS server via RFC 2136 dynamic DNS updates usingnsupdate. The choice between local and remote DNS updates can be made on a zone by zone basis.Configurable Output File NamesServer administrators often develop their own file naming conventions or need to match naming conventions of other tools. The names and output directories of all certificate, key, and related files are fully configurable. The defaults are intended for standard Debian installations.Configurable Deployment HooksEach operation that writes key, certificate, or related files have optional hooks that can call user-specified programs to assist in deploying resources to remote servers or coordinating with other tooling.Certificate Installation VerificationThis tool can automatically connect to configured servers and verify that the generated certificates are properly served via TLS. Additional checks are made for OSCP staples and optionally HPKP headers can be verified as well.ACME Protocol V1 and V2 SupportThis tool supports services running both ACME V1 and ACME V2 APIs. Wildcard certrificates may be issued when using the V2 API.InstallationRequires Python 3.7+ and the OpenSSL support.On Debian Stretch and later:sudo apt-get install python3-pip libssl-dev libffi-dev sudo pip3 install acmebotYou may want to create a virtual environment and install acmebot there. Copy either theacmebot.example.jsonfile or theacmebot.example.yamlfile toacmebot.json(oracmebot.yaml) and edit the configuration options. The configuration file can be placed in the current directory that the tool is run from, the /etc/acmebot directory, or the same directory that the acmebot tool is installed in.By default, debug level output will be written to a log file. A configuration file for logrotate is provided in the logrotate.d directory, you may want to copy, or create a link to this file in /etc/logrotate.d.Note that when using dns-01 authorizations via a local DNS server, this tool needs to be able to add, remove, and update DNS records. This can be achieved by installing it on your master DNS server and usingbindtoolto manage the zone file, or you can use a custom shell script to update the DNS records.When using dns-01 authorizations via a remote server, an update key allowing the creation and deletion of TXT and optionally TLSA record types is required.Optional: some services require a full certificate chain including the root (OSCP stapling on Nginx, for example). In order to generate these files, place a copy of the root certificates from your certificate authority of choice in the same directory as the configuration file with the file namesroot_cert.rsa.pemandroot_cert.ecdsa.pemfor RSA and ECDSA certificate roots respectively. Note that the root certificates are the those used to sign RSA and ECDSA client certificates, and may not necessarily be of the same type, e.g. Let’s Encrypt currently signs ECDSA certificates with an RSA root. If your certificate authority uses RSA certificate to sign ECDSA certificates types, place that RSA root certificate inroot_cert.ecdsa.pem. The root certificate for Let’s Encrypt can be obtainedhere.UpgradeStarting with version 2.0.0 of this tool, the Let’s Encrypt ACME V2 API is used by default. When upgrading to version 2.0.0+, or otherwise changing API endpoints, the client key is regenerated and a new registration is performed. If running in master/follower mode, be sure to run the tool on the master first, then copy the new client key and registration files to the followers before running on the followers. Existing private keys and certificates may continue to be used.Quick StartBasic ConfigurationWhile the example configuration file may appear complicated, it is meant to show all possible configuration options and their defaults, rather than demonstrate a basic simple configuration.The only items that must be present in the configuration file to create and maintain a certificate are your account email address, and the file name for the certificate. By default, the common name of the certificate will be the same as the certificate file name.For example:{ "account": { "email": "[email protected]" }, "certificates": { "example.com": { "alt_names": { "example.com": ["@", "www"] } } } }will create a certificate namedexample.com, with the common name ofexample.com, and the subject alternative names ofexample.comandwww.example.com.As many certificates as desired may be configured. The number of alternative names is limited by the certificate authority (Let’s Encrypt currently allows 100). Alternative names are specified on a DNS zone basis, multiple zones may be specified per certificate. The host name"@"is used for the name of the zone itself.Authorization SetupBy default, the tool will attempt dns-01 domain authorizations for every alternative name specified, using local DNS updates. See the later sections on configuringlocalorremoteDNS updates.To use http-01 authorizations instead, configure thehttp_challengessection of the configuration file specifying a challenge directory for each fully qualified host name.For example:{ ... "http_challenges": { "example.com": "/var/www/htdocs/.well-known/acme-challenge", "www.example.com": "/var/www/htdocs/.well-known/acme-challenge" } }See theHTTP Challengessection for more information.First RunOnce the configuration file is in place, simply execute the tool. For the first run you may wish to select detailed output to see exactly what the tool is doing:acmebot --detailIf all goes well, the tool will generate a public/private key pair used for client authentication to the certificate authority, register an account with the certificate authority, prompt to accept the certificate authority’s terms of service, obtain authorizations for each configured domain name, generate primary private keys as needed for the configured certificates, issue certificates, generate backup private keys, generate custom Diffie-Hellman parameters, retrieve Signed Certificate Timestamps from certificate transparency logs, retrieve an OCSP response from the certificate authority, and install the certificates and private keys into /etc/ssl/certs and /etc/ssl/private.If desired, you can test the tool using Let’s Encrypt’s staging server. To do this, specify the staging server’s directory URL in theacme_directory_urlsetting. SeeStaging Environmentfor details. When switching from the staging to production servers, you should delete the client key and registration files (/var/local/acmebot/*.json) to ensure a fresh registration in the production environment.File LocationAfter a successful certificate issuance, up to twenty one files will be created per certificate.The locations for these files can be controlled via thedirectoriessection of the configuration file. The default locations are used here for brevity.Output files will be written as a single transaction, either all files will be written, or no files will be written. This is designed to prevent a mismatch between certificates and private keys should an error happen during file creation.Private KeysTwo private key files will be created in /etc/ssl/private for each key type. The primary:<private-key-name>.<key-type>.key; and a backup key:<private-key-name>_backup.<key-type>.key.The private key files will be written in PEM format and will be readable by owner and group.Certificate FilesTwo certificate files will be created for each key type, one in /etc/ssl/certs, named<certificate-name>.<key-type>.pem, containing the certificate, followed by any intermediate certificates sent by the certificate authority, followed by custom Diffie-Hellman and elliptic curve paramaters; the second file will be created in /etc/ssl/private, named<certificate-name>_full.<key-type>.key, and will contain the private key, followed by the certificate, followed by any intermediate certificates sent by the certificate authority, followed by custom Diffie-Hellman and elliptic curve paramaters.The<certificate-name>_full.<key-type>.keyfile is useful for services that require both the private key and certificate to be in the same file, such as ZNC.Intermediate Certificate Chain FileIf the certificate authority uses intermediate certificates to sign your certificates, a file will be created in /etc/ssl/certs, named<certificate-name>_chain.<key-type>.pemfor each key type, containing the intermediate certificates sent by the certificate authority.This file will not be created if thechaindirectory is set tonull.Note that the certificate authority may use a different type of certificate as intermediates, e.g. an ECDSA client certificate may be signed by an RSA intermediate, and therefore the intermediate certificate key type may not match the file name (or certificate type).Full Chain Certificate FileIf theroot_cert.<key-type>.pemfile is present (seeInstallation), then an additional certificate file will be generated in /etc/ssl/certs, named<certificate-name>+root.<key-type>.pemfor each key type. This file will contain the certificate, followed by any intermediate certificates sent by the certificate authority, followed by the root certificate, followed by custom Diffie-Hellman and elliptic curve paramaters.If theroot_cert.<key-type>.pemfile is not found in the same directory as the configuration file, this certificate file will not be created.This file is useful for configuring OSCP stapling on Nginx servers.Diffie-Hellman Parameter FileIf custom Diffie-Hellman parameters or a custom elliptical curve are configured, a file will be created in /etc/ssl/params, named<certificate-name>_param.pem, containing the Diffie-Hellman parameters and elliptical curve paramaters.This file will not be created if theparamdirectory is set tonull.Hypertext Public Key Pin (HPKP) FilesTwo additional files will be created in /etc/ssl/hpkp, named<private-key-name>.apacheand<private-key-name>.nginx. These files contain HTTP header directives setting HPKP for both the primary and backup private keys for each key type.Each file is suitable to be included in the server configuration for either Apache or Nginx respectively.Thess files will not be created if thehpkpdirectory is set tonull.Signed Certificate Timestamp (SCT) FilesOne additional file will be created for each key type and configured certificate transparency log in/etc/ssl/scts/<certificate-name>/<key-type>/<log-name>.sct. These files contain SCT information in binary form suitable to be included in a TLS extension. By default, SCTs will be retrieved from the Google Icarus and Google Pilot certificate transparency logs. The Google Test Tube certificate transparency log can be used with the Let’s Encrypt staging environment for testing.OCSP Response FilesOne OCSP response file will be created for each key type, in /etc/ssl/ocsp, named<certificate-name>.<key_type>.ocsp. These files contain OCSP responses in binary form suitable to be used as stapled OCSP responses.Archive DirectoryWhenever exsiting files are replaced by subsequent runs of the tool, for example during certificate renewal or private key rollover, all existing files are preserved in the archive directory, /etc/ssl/archive.Within the archive directory, a directory will be created with the name of the private key, containing a datestamped directory with the time of the file transaction (YYYY_MM_DD_HHMMSS). All existing files will be moved into the datestamped directory should they need to be recovered.Server ConfigurationBecause certificate files will be periodically replaced as certificates need to be renewed, it is best to have your server configurations simply refer to the certificate and key files in the locations they are created. This will prevent server configurations from having to be updated as certificate files are replaced.If the server requires the certificate or key file to be in a particular location or have a different file name, it is best to simply create a soft link to the certificate or key file rather than rename or copy the files.Another good practice it to isolate the configuration for each certificate into a snippet file, for example using Apache, create the file /etc/apache2/snippets/ssl/example.com containing:SSLCertificateFile /etc/ssl/certs/example.com.rsa.pem SSLCertificateKeyFile /etc/ssl/private/example.com.rsa.key CTStaticSCTs /etc/ssl/certs/example.com.rsa.pem /etc/ssl/scts/example.com/rsa # requires mod_ssl_ct to be installed SSLCertificateFile /etc/ssl/certs/example.com.ecdsa.pem SSLCertificateKeyFile /etc/ssl/private/example.com.ecdsa.key CTStaticSCTs /etc/ssl/certs/example.com.ecdsa.pem /etc/ssl/scts/example.com/ecdsa # requires mod_ssl_ct to be installed Header always set Strict-Transport-Security "max-age=63072000" Include /etc/ssl/hpkp/example.com.apacheand then in each host configuration using that certificate, simply add:Include snippets/ssl/example.comFor Nginx the /etc/nginx/snippets/ssl/example.com file would contain:ssl_ct on; # requires nginx-ct module to be installed ssl_certificate /etc/ssl/certs/example.com.rsa.pem; ssl_certificate_key /etc/ssl/private/example.com.rsa.key; ssl_ct_static_scts /etc/ssl/scts/example.com/rsa; # requires nginx-ct module to be installed ssl_stapling_file /etc/ssl/ocsp/example.com.rsa.ocsp; ssl_certificate /etc/ssl/certs/example.com.ecdsa.pem; # requires nginx 1.11.0+ to use multiple certificates ssl_certificate_key /etc/ssl/private/example.com.ecdsa.key; ssl_ct_static_scts /etc/ssl/scts/example.com/ecdsa; # requires nginx-ct module to be installed ssl_stapling_file /etc/ssl/ocsp/example.com.ecdsa.ocsp; # requires nginx 1.13.3+ to use with multiple certificates ssl_trusted_certificate /etc/ssl/certs/example.com+root.rsa.pem; # not required if using ssl_stapling_file ssl_dhparam /etc/ssl/params/example.com_param.pem; ssl_ecdh_curve secp384r1; add_header Strict-Transport-Security "max-age=63072000" always; include /etc/ssl/hpkp/example.com.nginx;and can be used via:include snippets/ssl/example.com;ConfigurationThe configuration fileacmebot.jsonoracmebot.yamlmay be placed in the current working directory, in /etc/acmebot, or in the same directory as the acmebot tool is installed in. A different configuration file name may be specified on the command line. If the specified file name is not an absolute path, it will be searched for in the same locations, e.g.acmebot--configconfig.jsonwill load./config.json,/etc/acmebot/config.json, or<install-dir>/config.json. If the file extension is omitted, the tool will search for a file with the extensions:.json,.yaml, and.ymlin each location. If the speficied file is an absolute path, only that location will be searched.Additional configuration files may be placed in a subdirectory namedconf.din the same directory as the configuration file. All files with the extensions:.json,.yaml, or.ymlin that subdirectory will be loaded and merged into the configuration, overriding any settings in the main configuration file. For example, the configurtaion for each certificate may be placed in a separate file, while the common settings remain in the main configuration file.The configuration file must adhere to standard JSON or YAML formats. The examples given in this document are in JSON format, however, the equivalent structures may be expressed in YAML.The filesacmebot.example.jsonandacmebot.example.yamlprovide a template of all configuration options and their default values. Entries inside angle brackets"<example>"must be replaced (without the angle brackets), all other values may be removed unless you want to override the default values.AccountEnter the email address you wish to associate with your account on the certificate authority. This email address may be useful in recovering your account should you lose access to your client key.Example:{ "account": { "email": "[email protected]" }, ... }SettingsVarious settings for the tool. All of these need only be present when the desired value is different from the default.follower_modespecifies if the tool should run in master or follower mode. The defalt value isfalse(master mode). The master will obtain authorizations and issue certificates, a follower will not attempt to obtain authorizations but can issue certificates.log_levelspecifies the amount of information written into the log file. Possible values arenull,"normal","verbose","debug", and"detail"."verbose","debug", and"detail"settings correlate to the--verbose,--debugand--detailcommand-line options.color_outputspecifies if the output should be colorized. Colorized output will be suppressed on non-tty devices. This option may be overridden via command line options. The default value istrue.key_typesspecifies the types of private keys to generate by default. The default value is['rsa', 'ecdsa'].key_sizespecifies the size (in bits) for RSA private keys. The default value is4096. RSA certificates can be turned off by setting this value to0ornull.key_curvespecifies the curve to use for ECDSA private keys. The default value is"secp384r1". Available curves are"secp256r1","secp384r1", and"secp521r1". ECDSA certificates can be turned off by setting this value tonull.key_cipherspecifies the cipher algorithm used to encrypt private keys. The default value is"blowfish". Available ciphers are those accepted by your version of OpenSSL’s EVP_get_cipherbyname().key_passphrasespecifies the passphrase used to encrypt private keys. The default value isnull. A value ofnullorfalsewill result in private keys being written unencrypted. A value oftruewill cause the password to be read from the command line, the environment, a prompt, or stdin. A string value will be used as the passphrase without further input.key_providedspecifies that the private keys are provided from an external source and the tool should not modify them. The default value isfalse.dhparam_sizespecifies the size (in bits) for custom Diffie-Hellman parameters. The default value is2048. Custom Diffie-Hellman parameters can be turned off by setting this value to0ornull. This value should be at least be equal to half thekey_size.ecparam_curvespeficies the curve or list of curves to use for ECDHE negotiation. This value may be a string or a list of strings. The default value is["secp521r1", "secp384r1", "secp256k1"]. Custom EC parameters can be turned off by setting this value tonull. You can runopenssl ecparam-list_curvesto find a list of available curves.file_userspecifies the name of the user that will own certificate and private key files. The default value is"root". Note that this tool must run as root, or another user that has rights to set the file ownership to this user.file_groupspeficies the name of the group that will own certificate and private key files. The default value is"ssl-cert". Note that this tool must run as root, or another user that has rights to set the file ownership to this group.log_userspecifies the name of the user that will own log files. The default value is"root". Note that this tool must run as root, or another user that has rights to set the file ownership to this user.log_groupspeficies the name of the group that will own log files. The default value is"adm". Note that this tool must run as root, or another user that has rights to set the file ownership to this group.warning_exit_codespecifies if warnings will produce a non-zero exit code. The default value isfalse.hpkp_daysspecifies the number of days that HPKP pins should be cached for. The default value is60. HPKP pin files can be turned off by setting this value to0ornull.pin_subdomainsspecifies whether theincludeSubdomainsdirective should be included in the HPKP headers. The default value istrue.hpkp_report_urispecifies the uri to report HPKP failures to. The default value isnull. If not null, thereport-uridirective will be included in the HPKP headers.ocsp_must_staplespecifies if the OCSP Must-Staple extension is added to certificates. The default value isfalse.ocsp_responder_urlsspecifies the list of OCSP responders to use if a certificate doesn’t provide them. The default value is["http://ocsp.int-x3.letsencrypt.org"].ct_submit_logsspecifies the list of certificate transparency logs to submit certificates to. The default value is["google_icarus", "google_pilot"]. The value["google_testtube"]can be used with the Let’s Encrypt staging environment for testing.renewal_daysspecifies the number of days before expiration when the tool will attempt to renew a certificate. The default value is30.expiration_daysspecifies the number of days that private keys should be used for. The dafault value is730(two years). When the backup key reaches this age, the tool will notify the user that a key rollover should be performed, or automatically rollover the private key ifauto_rolloveris set totrue. Automatic rollover and expiration notices can be disabled by setting this to0ornull.auto_rolloverspecifies if the tool should automatically rollover private keys that have expired. The default value isfalse. Note that when running in a master/follower configuration and sharing private keys between the master and follower, key rollovers must be performed on the master and manually transferred to the follower, therefore automatic rollovers should not be used unless running stand-alone.max_dns_lookup_attemptsspecifies the number of times to check for deployed DNS records before attempting authorizations. The default value is60.dns_lookup_delayspecifies the number of seconds to wait between DNS lookups. The default value is10.max_domains_per_orderspecifies the maximum number of domains allowed per authorization order. The default value is100, which is the limit set by Let’s Encrypt.max_authorization_attemptsspecifies the number of times to check for completed authorizations. The default value is30.authorization_delayspecifies the number of seconds to wait between authorization checks. The default value is10.cert_poll_timespecifies the number of seconds to wait for a certificate to be issued. The default value is30.max_ocsp_verify_attemptsspecifies the number of times to check for OCSP staples during verification. Retries will only happen when the certificate has the OCSP Must-Staple extension. The default value is10.ocsp_verify_retry_delayspecifies the number of seconds to wait between OCSP staple verification attempts. The default value is5.min_run_delayspecifies the minimum number of seconds to wait if the--randomwaitcommand line option is present. The default value is300.max_run_delayspecifies the maximum number of seconds to wait if the--randomwaitcommand line option is present. The default value is3600.acme_directory_urlspecifies the primary URL for the ACME service. The default value is"https://acme-v02.api.letsencrypt.org/directory", the Let’s Encrypt production API. You can substitute the URL for Let’s Encrypt’s staging environment or another certificate authority.acme_directory_verify_sslspecifies whether or not to verify the certificate of the ACME service. The default value isTrue. Setting this toFalseis not recommneded, but may be necessary in environments using a private ACME server.reload_zone_commandspecifies the command to execute to reload local DNS zone information. When usingbindtoolthe"reload-zone.sh"script provides this service. If not using local DNS updates, you may set this tonullto avoid warnings.nsupdate_commandspecifies the command to perform DNS updates. The default value is"/usr/bin/nsupdate".verifyspecifies the default ports to perform installation verification on. The default value isnull.servicesspecifies the default services to associate with certificates. The default value isnull.Example:{ ... "settings": { "follower_mode": false, "log_level": "debug", "key_size": 4096, "key_curve": "secp384r1", "key_cipher": "blowfish", "key_passphrase": null, "key_provided": false, "dhparam_size": 2048, "ecparam_curve": ["secp521r1", "secp384r1", "secp256k1"], "file_user": "root", "file_group": "ssl-cert", "hpkp_days": 60, "pin_subdomains": true, "hpkp_report_uri": null, "ocsp_must_staple": false, "ocsp_responder_urls": ["http://ocsp.int-x3.letsencrypt.org"], "ct_submit_logs": ["google_icarus", "google_pilot"], "renewal_days": 30, "expiration_days": 730, "auto_rollover": false, "max_dns_lookup_attempts": 60, "dns_lookup_delay": 10, "max_authorization_attempts": 30, "authorization_delay": 10, "min_run_delay": 300, "max_run_delay": 3600, "acme_directory_url": "https://acme-v02.api.letsencrypt.org/directory", "reload_zone_command": "/etc/bind/reload-zone.sh", "nsupdate_command": "/usr/bin/nsupdate", "verify": [443] }, ... }DirectoriesDirectories used to store the input and output files of the tool. Relative paths will be considered relative to the directory of configuration file. All of these need only be present when the desired value is different from the default.pidspecifies the directory to store a process ID file. The default value is"/var/run".logspecifies the directory to store the log file. The default value is"/var/log/acmebot".resourcespecifies the directory to store the client key and registration files for the ACME account. The default value is"/var/local/acmebot".private_keyspecifies the directory to store primary private key files. The default value is"/etc/ssl/private".backup_keyspecifies the directory to store backup private key files. The default value is"/etc/ssl/private".previous_keyspecifies the directory to store previously used private key files after key rollover. The default value isnull.full_keyspecifies the directory to store primary private key files that include the certificate chain. The default value is"/etc/ssl/private". Full key files may be omitted by setting this tonull.certificatespecifies the directory to store certificate files. The default value is"/etc/ssl/certs".full_certificatespecifies the directory to store full chain certificate files that include the root certificate. The default value is"/etc/ssl/certs". Full certificate files may be omitted by setting this tonull.chainspecifies the directory to store certificate intermediate chain files. The default value is"/etc/ssl/certs". Chain files may be omitted by setting this tonull.paramspecifies the directory to store Diffie-Hellman parameter files. The default value is"/etc/ssl/params". Paramater files may be omitted by setting this tonull.challengespecifies the directory to store ACME dns-01 challenge files. The default value is"/etc/ssl/challenge".http_challengespecifies the directory to store ACME http-01 challenge files. The default value isnull.hpkpspecifies the directory to store HPKP header files. The default value is"/etc/ssl/hpkp". HPKP header files may be turned off by setting this tonull.sctspecifies the directory to store Signed Certificate Timestamp files. The default value is"/etc/ssl/scts/<certificate-name>/<key-type>". SCT files may be turned off by setting this tonull.ocspspecifies the directory to store OCSP response files. The default value is"/etc/ssl/ocsp". OCSP response files may be turned off by setting this tonull.update_keyspecifies the directory to search for DNS update key files. The default value is"/etc/ssl/update_keys".archivespecifies the directory to store older versions of files that are replaced by this tool. The default value is"/etc/ssl/archive".tempspecifies the directory to write temporary files to. A value ofnullresults in using the system defined temp directory. The temp directory must be on the same file system as the output file directories. The default value isnull.Example:{ ... "directories": { "pid": "/var/run", "log": "/var/log/acmebot", "resource": "/var/local/acmebot", "private_key": "/etc/ssl/private", "backup_key": "/etc/ssl/private", "full_key": "/etc/ssl/private", "certificate": "/etc/ssl/certs", "full_certificate": "/etc/ssl/certs", "chain": "/etc/ssl/certs", "param": "/etc/ssl/params", "challenge": "/etc/ssl/challenges", "http_challenge": "/var/www/{zone}/{host}/.well-known/acme-challenge", "hpkp": "/etc/ssl/hpkp", "ocsp": "/etc/ssl/ocsp/", "sct": "/etc/ssl/scts/{name}/{key_type}", "update_key": "/etc/ssl/update_keys", "archive": "/etc/ssl/archive" }, ... }Directory values are treated as Python format strings, fields available for directories are:name,key_type,suffix,server. Thenamefield is the name of the private key or certificate. The"http_challenge"directory uses the fields:zone,host, andfqdn, for the zone name, host name (without the zone), and the fully qualified domain name respectively. Thehostvalue will be"."if the fqdn is the same as the zone name.ServicesThis specifies a list of services that are used by issued certificates and the commands necessary to restart or reload the service when a certificate is issued or changed. You may add or remove services as needed. The list of services is arbritrary and they are referenced from individual certificate definitions.Example:{ ... "services": { "apache": "systemctl reload apache2", "coturn": "systemctl restart coturn", "dovecot": "systemctl restart dovecot", "etherpad": "systemctl restart etherpad", "mysql": "systemctl reload mysql", "nginx": "systemctl reload nginx", "postfix": "systemctl reload postfix", "postgresql": "systemctl reload postgresql", "prosody": "systemctl restart prosody", "slapd": "systemctl restart slapd", "synapse": "systemctl restart matrix-synapse", "znc": "systemctl restart znc" }, ... }To specify one or more services used by a certificate, add aservicessection to the certificate definition listing the services using that certificate.For example:{ "certificates": { "example.com": { "alt_names": { "example.com": ["@", "www"] }, "services": ["nginx"] } } }This will cause the command"systemctl reload nginx"to be executed any time the certificateexample.comis issued, renewed, or updated.CertificatesThis section defines the set of certificates to issue and maintain. The name of each certificate is used as the name of the certificate files.common_namespecifies the common name for the certificate. If omitted, the name of the certificate will be used.alt_namesspecifies the set of subject alternative names for the certificate. If specified, the common name of the certificate must be included as one of the alternative names. The alternative names are specified as a list of host names per DNS zone, so that associated DNS updates happen in the correct zone. The zone name may be used directly by specifying"@"for the host name. Multiple zones may be specified. The default value is the common name of the certificate in the zone of the first registered domain name according to thePublic Suffix List. For example, if the common name is “example.com”, the defaultalt_nameswill be:{"example.com":["@"]}; if the common name is “foo.bar.example.com”, the defaultalt_nameswill be:{ "example.com": ["foo.bar"] }.servicesspecifies the list of services to be reloaded when the certificate is issued, renewed, or modified. This may be omitted. The default value is the value specified in thesettingssection.dhparam_sizespecifies the number of bits to use for custom Diffie-Hellman paramaters for the certificate. The default value is the value specified in thesettingssection. Custom Diffie-Hellman paramaters may be ommitted from the certificate by setting this to0ornull. The value should be at least equal to half the number of bits used for the private key.ecparam_curvespecified the curve or curves used for elliptical curve paramaters. The default value is the value specified in thesettingssection. Custom elliptical curve paramaters may be ommitted from the certificate by setting this tonull.key_typesspecifies the types of keys to create for this certificate. The default value is all available key types. Provide a list of key types to restrict the certificate to only those types. Available types are"rsa"and"ecdsa".key_sizespecifies the number of bits to use for the certificate’s RSA private key. The default value is the value specified in thesettingssection. RSA certificates can be turned off by setting this value to0ornull.key_curvespecifies the curve to use for ECDSA private keys. The default value is the value specified in thesettingssection. Available curves are"secp256r1","secp384r1", and"secp521r1". ECDSA certificates can be turned off by setting this value tonull.key_cipherspecifies the cipher algorithm used to encrypt the private keys. The default value is the value specified in thesettingssection. Available ciphers those accepted by your version of OpenSSL’s EVP_get_cipherbyname().key_passphrasespecifies the passphrase used to encrypt private keys. The default value is the value specified in thesettingssection. A value ofnullorfalsewill result in private keys being written unencrypted. A value oftruewill cause the password to be read from the command line, the environment, a prompt, or stdin. A string value will be used as the passphrase without further input.key_providedspecifies that the private keys are provided from an external source and the tool should not modify them. The default value is the value specified in thesettingssection. This is useful when the same private keys are shared between multiple instances of the tool, e.g. for HPKP purposes.expiration_daysspecifies the number of days that the backup private key should be considered valid. The default value is the value specified in thesettingssection. When the backup key reaches this age, the tool will notify the user that a key rollover should be performed, or automatically rollover the private key ifauto_rolloveris set totrue. Automatic rollover and expiration notices can be disabled by setting this to0ornull.auto_rolloverspecifies if the tool should automatically rollover the private key when it expires. The default value is the value specified in thesettingssection.hpkp_daysspecifies the number of days that HPKP pins should be cached by clients. The default value is the value specified in thesettingssection. HPKP pin files can be turned off by setting this value to0ornull.pin_subdomainsspecifies whether theincludeSubdomainsdirective should be included in the HPKP headers. The default value is the value specified in thesettingssection.hpkp_report_urispecifies the uri to report HPKP errors to. The default value is the value specified in thesettingssection. If not null, thereport-uridirective will be included in the HPKP headers.ocsp_must_staplespecifies if the OCSP Must-Staple extension is added to certificates. The default value is the value specified in thesettingssection.ocsp_responder_urlsspecifies the list of OCSP responders to use if a certificate doesn’t provide them. The default value is the value specified in thesettingssection.ct_submit_logsspecifies the list of certificate transparency logs to submit the certificate to. The default value is the value specified in thesettingssection. The value["google_testtube"]can be used with the Let’s Encrypt staging environment for testing.verifyspecifies the list of ports to perform certificate installation verification on. The default value is the value specified in thesettingssection.Example:{ ... "certificates": { "example.com": { "common_name": "example.com", "alt_names": { "example.com": ["@", "www"] }, "services": ["nginx"], "dhparam_size": 2048, "ecparam_curve": ["secp521r1", "secp384r1", "secp256k1"], "key_types": ["rsa", "ecdsa"], "key_size": 4096, "key_curve": "secp384r1", "key_cipher": "blowfish", "key_passphrase": null, "key_provided": false, "expiration_days": 730, "auto_rollover": false, "hpkp_days": 60, "pin_subdomains": true, "hpkp_report_uri": null, "ocsp_must_staple": false, "ocsp_responder_urls": ["http://ocsp.int-x3.letsencrypt.org"], "ct_submit_logs": ["google_icarus", "google_pilot"], "verify": [443] } } }Private KeysThis section defines the set of private keys generated and their associated certificates. Multiple certificates may share a single private key. This is useful when it is desired to use different certificates for certain subdomains, while specifying HPKP headers for a root domain that also apply to subdomains.The name of each private key is used as the file name for the private key files.Note that a certificate configured in thecertificatessection is equivalent to a private key configured in this section with a single certificate using the same name as the private key. As such, it is an error to specify a certificate using the same name in both thecertificatesandprivate_keyssections.The private key and certificate settings are identical to those specified in thecertificatessection, except settings relevant to the private key:key_size,key_curve,key_cipher,key_passphrase,key_provided,expiration_days,auto_rollover,hpkp_days,pin_subdomains, andhpkp_report_uriare specified in the private key object rather than the certificate object. Thekey_typessetting may be specified in the certificate, private key, or both.Example:{ ... "private_keys": { "example.com": { "certificates": { "example.com": { "common_name": "example.com", "alt_names": { "example.com": ["@", "www"] }, "services": ["nginx"], "key_types": ["rsa"], "dhparam_size": 2048, "ecparam_curve": ["secp521r1", "secp384r1", "secp256k1"], "ocsp_must_staple": true, "ct_submit_logs": ["google_icarus", "google_pilot"], "verify": [443] }, "mail.example.com": { "alt_names": { "example.com": ["mail", "smtp"] }, "services": ["dovecot", "postfix"], "key_types": ["rsa", "ecdsa"] } }, "key_types": ["rsa", "ecdsa"], "key_size": 4096, "key_curve": "secp384r1", "key_cipher": "blowfish", "key_passphrase": null, "key_provided": false, "expiration_days": 730, "auto_rollover": false, "hpkp_days": 60, "pin_subdomains": true, "hpkp_report_uri": null } }, ... }The above example will generate a single primary/backup private key set and two certificates,example.comandmail.example.comboth using the same private keys. An ECDSA certicicate will only be generated formail.example.com.TLSA RecordsWhen using remote DNS updates, it is possible to have the tool automatically maintain TLSA records for each certificate. Note that this requires configuring zone update keys for each zone containing a TLSA record.When using local DNS updates, thereload_zonecommand will be called after certificates are issued, renewed, or modified to allow TLSA records to be updated by a tool such asbindtool. Thereload_zonecommand will not be called in follower mode.To specify TLSA records, add atlsa_recordsname/object pair to each certificate definition, either in thecertificatesorprivate_keyssection. TLSA records are specified per DNS zone, similar toalt_names, to specify which zone should be updated for each TLSA record.For each zone in the TLSA record object, specify a list of either host name strings or objects. Using a host name string is equivalent to:{ "host": "<host-name>" }The values for the objects are:hostspecifies the host name for the TLSA record. The default value is"@". The host name"@"is used for the name of the zone itself.portspecifies the port number for the TLSA record. The default value is443.usageis one of the following:"pkix-ta","pkix-ee","dane-ta", or"dane-ee". The default value is"pkix-ee". When specifying an end effector TLSA record ("pkix-ee"or"dane-ee"), the hash generated will be of the certificate or public key itself. When specifying a trust anchor TLSA record ("pkix-ta"or"dane-ta"), records will be generated for each of the intermediate and root certificates.selectoris one of the following:"cert", or"spki". The default value is"spki". When specifying a value of"spki"and an end effector usage, records will be generated for both the primary and backup public keys.protocolspecifies the protocol for the TLSA record. The default value is"tcp".ttlspecifies the TTL value for the TLSA records. The default value is300.Example:{ ... "private_keys": { "example.com": { "certificates": { "example.com": { "alt_names": { "example.com": ["@", "www"] }, "services": ["nginx"], "tlsa_records": { "example.com": [ "@", { "host": "www", "port": 443, "usage": "pkix-ee", "selector": "spki", "protocol": "tcp", "ttl": 300 } ] } }, "mail.example.com": { "alt_names": { "example.com": ["mail", "smtp"] }, "services": ["dovecot", "postfix"], "tlsa_records": { "example.com": [ { "host": "mail", "port": 993 }, { "host": "smtp", "port": 25, "usage": "dane-ee" }, { "host": "smtp", "port": 587 } } } } } } }, ... }AuthorizationsThis section specifies a set of host name authorizations to obtain without issuing certificates.This is used when running in a master/follower configuration, the master, having access to local or remote DNS updates or an HTTP server, obtains authorizations, while the follower issues the certificates.It is not necessary to specify host name authorizations for any host names used by configured certificates, but it is not an error to have overlap.Authorizations are specified per DNS zone so that associated DNS updates happen in the correct zone.Simplar toalt-names, a host name of"@"may be used to specify the zone name.Example:{ ... "authorizations": { "example.com": ["@", "www"] }, ... }HTTP ChallengesBy default, the tool will attempt dns-01 domain authorizations for every alternative name specified, using local or remote DNS updates.To use http-01 authorizations instead, configure thehttp_challengessection of the configuration file specifying a challenge directory for each fully qualified domain name, or configure ahttp_challengedirectory.It is possible to mix usage of dns-01 and http-01 domain authorizations on a host by host basis, simply specify a http challenge directory only for those hosts requiring http-01 authentication.Example:{ ... "http_challenges": { "example.com": "/var/www/htdocs/.well-known/acme-challenge" "www.example.com": "/var/www/htdocs/.well-known/acme-challenge" }, ... }Thehttp_challengesmust specify a directory on the local file system such that files placed there will be served via an already running http server for each given domain name. In the above example, files placed in/var/www/htdocs/.well-known/acme-challengemust be publicly available at:http://example.com/.well-known/acme-challenge/file-nameandhttp://www.example.com/.well-known/acme-challenge/file-nameAlternatively, if your are primarily using http-01 authorizations and all challenge directories have a similar path, you may configure a singlehttp_challengedirectory using a python format string with the fieldszone,host, andfqdn.Example:{ ... "directories": { "http_challenge": "/var/www/{zone}/{host}/.well-known/acme-challenge" }, ... }If anhttp_challengedirectory is configured, all domain authorizations will default to http-01. To use dns-01 authorizations for selected domain names, add anhttp_challengesentry configured with anullvalue.Zone Update KeysWhen using remote DNS updates, it is necessary to specify a TSIG key used to sign the update requests.For each zone using remote DNS udpates, specify either a string containing the file name of the TSIG key, or an object with further options.The TSIG file name may an absolute path or a path relative to theupdate_keydirectory setting. Both the<key-file>.keyfile and the<key-file>.privatefiles must be present.Any zone referred to in a certificate, private key, or authorization that does not have a corresponding zone update key will use local DNS updates unless an HTTP challenge directory has been specified for every host in that zone.filespecifies the name of the TSIG key file.serverspecifies the name of the DNS server to send update requests to. If omitted, the primary name server from the zone’s SOA record will be used.portspecifies the port to send update requests to. The default value is53.Example:{ ... "zone_update_keys": { "example1.com": "update.example1.com.key", "example2.com": { "file": "update.example2.com.key", "server": "ns1.example2.com", "port": 53 } }, ... }Key Type SuffixEach certificate and key file will have a suffix, just before the file extension, indicating the type of key the file is for.The default suffix used for each key type can be overridden in thekey_type_suffixessection. If you are only using a single key type, or want to omit the suffix from one key type, set it to an empty string. Note that if using multiple key types the suffix must be unique or files will be overridden.Example:{ ... "key_type_suffixes": { "rsa": ".rsa", "ecdsa": ".ecdsa" }, ... }File Name PatternsAll output file names can be overridden using standard Python format strings. Fields available for file names are:name,key_type,suffix,server. Thenamefield is the name of the private key or certificate.logspecifies the name of the log file.private_keyspecifies the name of primary private key files.backup_keyspecifies the name of backup private key files.full_keyspecifies the name of primary private key files that include the certificate chain.certificatespecifies the name of certificate files.full_certificatespecifies the name of certificate files that include the root certificate.chainspecifies the name of intemediate certificate files.paramspecifies the name of Diffie-Hellman parameter files.challengespecifies the name of ACME challenge files used for local DNS updates.hpkpspecifies the name of HPKP header files.ocspspecifies the name of OCSP response files.sctspecifies the name of SCT files.Example:{ ... "file_names": { "log": "acmebot.log", "private_key": "{name}{suffix}.key", "backup_key": "{name}_backup{suffix}.key", "full_key": "{name}_full{suffix}.key", "certificate": "{name}{suffix}.pem", "full_certificate": "{name}+root{suffix}.pem", "chain": "{name}_chain{suffix}.pem", "param": "{name}_param.pem", "challenge": "{name}", "hpkp": "{name}.{server}", "ocsp": "{name}{suffix}.ocsp", "sct": "{ct_log_name}.sct" }, ... }HPKP HeadersThis section defines the set of HPKP header files that will be generated and their contents. Header files for additional servers can be added at will, one file will be generated for each server. Using standard Python format strings, the{header}field will be replaced with the HPKP header, the{key_name}field will be replaced with the name of the private key, and{server}will be replaced with the server name. The default servers can be omitted by setting the header tonull.Example:{ ... "hpkp_headers": { "apache": "Header always set Public-Key-Pins \"{header}\"\n", "nginx": "add_header Public-Key-Pins \"{header}\" always;\n" }, ... }Certificate Transparency LogsThis section defines the set of certificate transparency logs available to submit certificates to and retrieve SCTs from. Additional logs can be aded at will. Each log definition requires the primary API URL of the log, and the log’s ID in base64 format. A list of currently active logs and their IDs can be found atcertificate-transparency.org.Example:{ ..., "ct_logs": { "google_pilot": { "url": "https://ct.googleapis.com/pilot", "id": "pLkJkLQYWBSHuxOizGdwCjw1mAT5G9+443fNDsgN3BA=" }, "google_icarus": { "url": "https://ct.googleapis.com/icarus", "id": "KTxRllTIOWW6qlD8WAfUt2+/WHopctykwwz05UVH9Hg=" } }, ... }Deployment HooksThis section defines the set of hooks that can be called via the shell when given actions happen. Paramaters to hooks are specified using Python format strings. Fields available for each hook are described below. Output from the hooks will be captured in the log. Hooks returing a non-zero status code will generate warnings, but will not otherwise affect the operation of this tool.set_dns_challengeis called for each DNS challenge record that is set. Available fields aredomain,zone, andchallenge.clear_dns_challengeis called for each DNS challenge record that is removed. Available fields aredomain,zone, andchallenge.dns_zone_updateis called when a DNS zone is updated via either local or remote updates. Available field iszone.set_http_challengeis called for each HTTP challenge file that is installed. Available fields aredomain, andchallenge_file.clear_http_challengeis called for each HTTP challenge file that is removed. Available fields aredomain, andchallenge_file.private_key_rolloveris called when a private key is replaced by a backup private key. Available fields arekey_name,key_type,backup_key_file,private_key_file,previous_key_file, andpassphrase.private_key_installedis called when a private key is installed. Available fields arekey_name,key_type,private_key_file, andpassphrase.backup_key_installedis called when a backup private key is installed. Available fields arekey_name,key_type,backup_key_file, andpassphrase.previous_key_installedis called when a previous private key is installed after key rollover. Available fields arekey_name,key_type,previous_key_file, andpassphrase.hpkp_header_installedis called when a HPKP header file is installed. Available fields arekey_name,server,header, andhpkp_file.certificate_installedis called when a certificate file is installed. Available fields arekey_name,key_type,certificate_name, andcertificate_file.full_certificate_installedis called when a certificate file that includes the root is installed. Available fields arekey_name,key_type,certificate_name, andfull_certificate_file.chain_installedis called when a certificate intermediate chain file is installed. Available fields arekey_name,key_type,certificate_name, andchain_file.full_key_installedis called when a private key including the full certificate chain file is installed. Available fields arekey_name,key_type,certificate_name, andfull_key_file.params_installedis called when a params file is installed. Available fields arekey_name,certificate_name, andparams_file.sct_installedis called when a SCT file is installed. Available fields arekey_name,key_type,certificate_name,ct_log_name, andsct_file.ocsp_installedis called when an OSCP file is installed. Available fields arekey_name,key_type,certificate_name, andocsp_file.Example:{ ... "hooks": { certificate_installed": "scp {certificate_file} remote-server:/etc/ssl/certs/" }, ... }Certificate Installation VerificationThe tool may be configured to perform installation verification of certificates. When verifying installation, the tool will connect to every subject alternative host name for each certificate on all avaialable IP addresses, per each configured port, perform a TLS handshake, and compare the served certificate chain to the specified certificate.Each configured port may be an integer port number, or an object specifying connection details.When using an object, the avaialable fields are:portspecifies the port number to connect to. Required.starttlsspecifies the STARTTLS mechanism that should be used to initiate a TLS session. Allowed values are:null,smtp,pop3,imap,sieve,ftp,ldap, andxmpp. The default value isnull.protocolspecifies the protocol used to obtain additional information to verify. Currently this can retrieve Public-Key-Pins http headers to ensure that they are properly set. Allowed values are:null, andhttp. The default value isnull.hostsspecifies a list of fully qualified domain names to test. This allows testing only a subset of the alternative names specified for the certificate. Each host name must be present as an alternative name for the certificate. The default value is all alternative names.key_typesspecifies a list of key types to test. This allows testing only a subset of the avaialable key types. The default value is all avaialable key types.Example:{ ... "verify": [ { "port": 443, "protocol": "http" }, { "port": 25, "starttls": "smtp", "hosts": "smtp.example.com", "key_types": "rsa" }, 993 ] ... }Configuring Local DNS UpdatesIn order to perform dns-01 authorizations, and to keep TLSA records up to date, the tool will need to be able to add, remove, and update various DNS records.For updating DNS on a local server, this tool was designed to use a bind zone file pre-processor, such asbindtool, but may be used with another tool instead.When usingbindtool, be sure to configure bindtool’sacme_pathto be equal to the value of thechallengedirectory, so that it can find the ACME challenge files.When the tool needs to update a DNS zone, it will call the configuredreload_zonecommand with the name of the zone as its argument. When _acme-challenge records need to be set, a file will be placed in thechallengedirectory with the name of the zone in question, e.g./etc/ssl/challenges/example.com. The challenge file is a JSON format file containing a single object. The name/value pairs of that object are the fully qualified domain names of the records needing to be set, and the values of the records, e.g.:{ "www.example.com": "gfj9Xq...Rg85nM" }Which should result in the following DNS record created in the zone:_acme-challenge.www.example.com. 300 IN TXT "gfj9Xq...Rg85nM"Note that domain names containing wildcards must have the wildcard component removed in the corresponding TXT record, e.g.:{ "example.com": "jc87sd...kO89hG" "*.example.com": "gfj9Xq...Rg85nM" }Must result in the following DNS records created in the zone:_acme-challenge.example.com. 300 IN TXT "jc87sd...kO89hG" _acme-challenge.example.com. 300 IN TXT "gfj9Xq...Rg85nM"If there is no file in thechallengedirectory with the same name as the zone, all _acme-challenge records should be removed.Any time thereload_zoneis called, it should also update any TLSA records asscoiated with the zone based on the certificates or private keys present.All of these functions are provided automatically bybindtoolvia the use of{{acme:}}and{{tlsa:}}commands in the zone file. For example, the zone file:{{soa:ns1.example.com:[email protected]}} {{ip4=192.0.2.0}} @ NS ns1 @ NS ns2 @ A {{ip4}} www A {{ip4}} {{tlsa:443}} {{tlsa:443:www}} {{acme:}} {{caa:letsencrypt.org}}Will define the zoneexample.comusing the nameserversns1.example.comandns1.example.com, providing the hostsexample.comandwww.example.com, with TLSA records pinning the primary and backup keys.Configuring Remote DNS UpdatesIf the tool is not run on a machine also hosting a DNS server, then http-01 authorizations or remote DNS updates must be used.The use remote DNS udpates via RFC 2136 dynamic updates, configure a zone update key for each zone. See theZone Update Keyssection for more information.It is also necesary to have thensupdatetool installed and thensupdate_commandconfigured in thesettingsconfiguration section.Zone update keys may be generated via thednssec-keygentool.For example:dnssec-keygen -r /dev/urandom -a HMAC-MD5 -b 512 -n HOST update.example.comwill generate two files, named Kupdate.example.com.+157+NNNNN.key and Kupdate.example.com.+157+NNNNN.private. Specify the .key file as the zone update key.To configure bind to allow remote DNS updates, add an entry to named.conf.keys for the update key containg the key value from the private key file, e.g.:key update.example.com. { algorithm hmac-md5; secret "sSeWrBDen...9WESlnEwQ=="; };and then add anallow-updateentry to the zone configuration, e.g.:zone "example.com" { type master; allow-update { key update.example.com.; }; ... };Running the ToolOn first run, the tool will generate a client key, register that key with the certificate authority, accept the certificate authority’s terms and conditions, perform all needed domain authorizations, generate primary private keys, issue certificates, generate backup private keys, generate custom Diffie-Hellman parameters, install certificate and key files, update TLSA records, retrieve current Signed Certificate Timestamps (SCTs) from configured certificate transparency logs, retrieve OCSP staples, reload services associated to the certificates, and perform configured certificate installation verification.Each subsequent run will ensure that all authorizations remain valid, check if any backup private keys have passed their expiration date, check if any certificate’s expiration dates are within the renewal window, or have changes to the configured common name, or subject alternative names, or no longer match their associated private key files.If a backup private key has passed its expiration date, the tool will rollover the private key or emit a warning recommending that the private key be rolled over, see thePrivate Key Rolloversection for more information.If a certificate needs to be renewed or has been modified, the certificate will be re-issued and reinstalled.When certificates are issued or re-issued, local DNS updates will be attempted (to update TLSA records) and associated services will be reloaded.When using remote DNS updates, all configured TLSA records will be verified and updated as needed on each run.Configured certificate transparency logs will be queried and SCT files will be updated as necessary.All certificates and private keys will normally be processed on each run, to restrict processing to specific private keys (and their certificates), you can list the names of the private keys to process on the command line.Daily Run Via cronIn order to ensure that certificates in use do not expire, it is recommended that the tool be run at least once per day via a cron job.By default, the tool only generates output when actions are taken making it cron friendly. Normal output can be supressed via the--quietcommand line option.To prevent multiple instances running at the same time, a random wait can be introduced via the--randomwaitcommand line option. The minimum and maximum wait times can be controlled via themin_run_delayandmax_run_delaysettings.Example cron entry, in file /etc/cron.d/acmebot:[email protected] 20 0 * * * root /usr/local/bin/acmebot --randomwaitThis will run the tool as root every day at 20 minutes past midnight plus a random delay of five minutes to an hour. Any output will be mailed [email protected] using OCSP response files, it may be desirable to refresh OCSP responses at a shorter interval. (Currently Let’s Encrypt updates OCSP responses every three days.) To refresh OCSP responses every six hours, add the line:20 6,12,18 * * * root /usr/local/bin/acmebot –ocsp –randomwaitOutput OptionsNormally the tool will only generate output to stdout when certificates are issued or private keys need to be rolled over. More detailed output can be obtained by using any of the--verbose,--debug, or--detailoptions on the command line.Normal output may be supressed by using the--quietoption.Error and warning output will be sent to stderr and cannot be supressed.The output can be colorized by type by adding the--coloroption, or colorized output can be suppressed via the--no-coloroption.Private Key RolloverDuring normal operations the private keys for certificates will not be modified, this allows renewing or modifying certificates without the need to update associated pinning information, such as HPKP headers or TLSA records using spki selectors.However, it is a good security practice to replace the private keys at regular intervals, or immediately if it is believed that the primary private key may have been compromised. This tool maintains a backup private key for each primary private key and generates pinning information including the backup key as appropriate to allow smooth transitions to the backup key.When the backup private key reaches the age specified via theexpiration_dayssetting, the tool will notify you that it is time to rollover the private key, unless theauto_rolloversetting has been set totrue, in which case it will automatically perform the rollover.The rollover process will archive the current primary private key, re-issue certificates using the existing backup key as the new primary key, generate a new backup private key, generate new custom Diffie-Hellman parameters, and reset HPKP headers and TLSA records as appropriate.If theprevious_keydirectory is specified, the current primary private key will be stored in that directory as a previous private key. While previous private key files are present, their key signatures will be added to HPKP pins and TLSA records. This can assist in key rollover when keys are pinned for subdomains and private keys are shared between multiple servers. Once the new primary and backup keys have been distributed to the other servers, the previous private key file may be safely removed.To manually rollover private keys, simply run the tool with the--rolloveroption. You can specify the names of individual private keys on the command line to rollover, otherwise all private keys will be rolled over.Note that the tool will refuse to rollover a private key if the current backup key is younger than the HPKP duration. A private key rollover during this interval may cause a web site to become inaccessable to clients that have previously cached HPKP headers but not yet retrieved the current backup key pin. If it is necessary to rollover the private key anyway, for example if it is believed that the backup key has been compromised as well, add the--forceoption on the command line to force the private key rollover.Forced Certificate RenewalNormally certificates will be automatically renewed when the tool is run within the certificate renewal window, e.g. withinrenewal_daysof the certificate’s expiration date. To cause certificates to be renewed before this time, run the tool with the--renewoption on the command line.Revoking CertificatesShould it become necessary to revoke a certificate, for example if it is believed that the private key has been compromised, run the tool with the--revokeoption on the command line.When revoking certificates, as a safety measure, it is necessary to also specify the name of the private key (or keys) that should be revoked. All certificates using that private key will be revoked, the certificate files and the primary private key file will be moved to the archive, and remote DNS TLSA records will be removed.The next time the tool is run after a revocation, any revoked certificates that are still configured will automatically perform a private key rollover.Authorization OnlyUse of the--authoption on the command line will limit the tool to only performing domain authorizations.Certificates OnlyUse of the--certsoption on the command line will limit the tool to only issuing and renewing certificates and keys, and updating related files such as Diffie-Hellman paramaters and HPKP headers.Remote TLSA UpdatesUse of the--tlsaoption on the command line will limit the tool to only verifying and updating configured TLSA records via remote DNS updates.Signed Certificate Timestamp UpdatesUse of the--sctoption on the command line will limit the tool to only verifying and updating configured Signed Certificate Timestamp files.OCSP Response UpdatesUse of the--ocspoption on the command line will limit the tool to only updating configured OCSP response files.Certificate Installation VerificationUse of the--verifyoption on the command line will limit the tool to only performing certificate installation verification.Multiple OperationsThe--auth,--certs,--tlsa,--sct,-ocsp, and--verifyoptions may be combined to perform a combinations of operations. If none of these options are specified, all operations will be performed as necessary and configured. The order of the operations will not be affected by the order of the command line options.Private Key EncryptionWhen encrypting private keys, a passphrase must be provided. There are several options for providing the key.Passphrases may be specified directly in the configuration file, both as a default passphrase applying to all keys, or specific passphrases for each key. Storing passphrases in cleartext in the configuration file obviously does little to protect the private keys if the configuration file is stored on the same machine. Either protect the configuration file or use an alternate method of providing passphrases.Alternatively, by setting the passphrase totruein the configuration file (the binary value, not the string"true"), the tool will attempt to obtain the passphrases at runtime.Runtime passphrases may be provided on the command line, via an environment variable, via a text prompt, or via an input file.A command line passphrase is passed via the--passoption, e.g.:acmebot --pass "passphrase"To use an environment variable, set the passphrase inACMEBOT_PASSPHRASE.A passphrase passed at the command line or an environment variable will be used for every private key that has it’skey_passphraseset totrue. If different passphrases are desired for different keys, run the tool for each key specifying the private key name on the command line to restrict processing to that key.If the passphrase is not provided on the command line or an environment variable, and the tool is run via a TTY device (e.g. manually in a terminal), it will prompt the user for each passphrase as needed. Different passphrases may be provided for each private key (the same passphrase will be used for all key types of that key).Finally, the passphrases may be stored in a file, one per line, and input redirected from that file, e.g.:acmebot < passphrase_file.txtPassphrases passed via an input file will be used in the order that the private keys are defined in the configuration file. If both certificates and private key sections are defined, the private keys will be processed first, then the certificates. You may wish to run the tool without the input file first to verify the private key order.Master/Follower SetupIn some circumstances, it is useful to run the tool in a master/follower configuration. In this setup, the master performs domain authorizations while the follower issues and maintains certificates.This setup is useful when the follower machine does not have the ability to perform domain authorizations, for example, an XMPP server behind a firewall that does not have port 80 open or access to a DNS server.To create a master/follower setup, first install and configure the tool on the master server as normal. The master server may also issue certificates, but it is not necessary.Configure any required domain authorizations (see theAuthorizationssection) on the master and run the tool.Then install the tool on the follower server. It is not necessary to configure HTTP challenges or remote DNS update keys on the follower.Before running the tool on the follower server, copy the client key and registration files from the master server. These files are normally found in/var/local/acmebotbut an alternate location can be configured in theresourcedirectory setting.If the master server also issues certificates for the same domain names or parent domain names as the follower, you may want to copy the primary and backup private keys for those certificates to the follower. This will cause the follower certificates to use the same keys allowing HPKP headers to safey include subdomains.Set the followerfollower_modesetting totrueand configure desired certificates on the follower.Run the tool on the follower server.When setting up cron jobs for the master and follower, be sure the follower runs several minutes after the master so that all authorizations will be complete. The master can theoretically take (max_dns_lookup_attemptsxdns_lookup_delay) + (max_authorization_attemptsxauthorization_delay) seconds to obtain domain authorizations (15 minutes at the default settings).It is possible to run several follower servers for each master, the follower cron jobs should not all run at the same time.The follower server may maintain TLSA records if remote DNS updates are configured on the follower, otherwise it is recommended to use spki selectors for TLSA records so that certificate renewals on the follower will not invalidate TLSA records.If private keys are shared between a master and follower, be sure to turn offauto_rolloverand only perform private key rollovers on the master. It is also useful to specify theprevious_keydirectory to preserve previous key pins during the key rollover process. After a private key rollover, copy the new primary and backup private key files to the followers. The follower will automatically detect the new private key and re-issue certificates on the next run. Once all the followers have updated their certificates to the new keys, you can safely delete the previous private key file.
acme-client
No description available on PyPI.
acme-client-lite
Lightweight ACME Client=======================
acmecontentcollectors-pkg-rioatmadja2018
# README #### Background Python wheel to help collect information about the Islamic State from the website, social medias, and videos.### LICENSE MIT LicenseCopyright (c) 2020 Rio AtmadjaPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
acme-dash-board-pkg-rioatmadja2018
# README ####ACME(Armed Conflict in the Middle East)### DESCRIPTIONThis is Bellevue University Data Science Milestones to study the Islamic State recruitments using social media.### DEPENDENCIES - acmecontentcollectors-pkg-rioatmadja2018==0.1.7511608612412 (Note: under development) - dash### LICENSE MIT LicenseCopyright (c) 2020 ratmadjadsPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
acme.dchat
What API ?NTT docomohasa chatting API.This software provides a client for the api.How to use?Get API KEY.Call client.>>>fromacme.dchatimportDocomoChatClient>>>c=DocomoChatClient('some api key')>>>c.talk('hello, world.')'Helloを聞くようです'
acme-dns-azure
IntroductionThis repository aims to leverage the automatic renewal of SSL certficates within Azure Cloud in a secure manner.A wrapper library is provided to automatically renew certifactes based on theACME DNS-01 challengeby usingcertbot.The library supports the usage of best practices for securely handling certificates by:using certbotremoving the need of a file system for storing certificatesAzure Key Vault for central and only storage of secrets and certificatesenabling easy and flexible automationInstalling acme-dns-azureacme-dns-azure is available on PyPi:python-mpipinstallacme-dns-azureFor usage examples please refer totargetsScopeBased on the provided configuration and trigger, the wrapper library supports following flow.Receive certificates, receive EAB & ACME credentials (if configured), receive ACME account information (if already present)Certbot: Init Renewal process to certificate AuthorityCertbot: DNS Challenge - create TXT recordCertbot: Renew certificatesCertbot: DNS Challenge - delete TXT recordUpload renewed certificates, create/update ACME account information as secretFeaturesThe library handles following use cases:Create new certificatesUpdate domain references in existing certificatesRenew existing certificatesAuth is possible by using:Service Principal(Planned) User Assigned IdentityIntegrationThe library can be used by:running as script(Planned): Python package within your appWithintargetsyou can find example implementations for running the python package:(Planned): Azure function(Planned): containerContributeFork, then clone the repo:gitclonehttps://github.com/ZEISS/acme-dns-azureInstall Poetry if you not have it already:curl-sSLhttps://install.python-poetry.org|python3-Configure the virtual environment with full targets support and activate it:Install dependenciespoetryinstall--all-extrassource.venv/bin/activateLintpoetryrunblack.Run unit testspoetryruncoveragerun poetryruncoveragereportRun integration testsSeetests/integrationUsageConfigThe config is written inYAML format, defined by the scheme described below. Brackets indicate that a parameter is optional. For non-list parameters the value is set to the specified default.Generic placeholders are defined as follows:<boolean>: a boolean that can take the valuestrueorfalse<int>: a regular integer<string>: a regular string<secret>: a regular string that is a secret, such as a password<regex>: a regular expressionThe other placeholders are specified separately.Seeexamplefor configuration examples.[managed_identity_id: <string>] [sp_client_id: <string>] [sp_client_secret: <secret>] [azure_environment: <regex> | default = "AzurePublicCloud"] # Flag if existing certificates containing multiple domains should be renewed and updated based on the definition of the config file. If not set, mismatching certificates will be skipped. [update_cert_domains: <boolean> | default = False] # key vault uri for renewal of certifcate key_vault_id : <regex> # ACME Certificate Authority server : <regex> # Secret name within key vault for storing ACME Certificate authority account information [keyvault_account_secret_name: <regex> | default "acme-account-$(network location of server)"] # when server=https://example.com/something, then keyvault_account_secret_name="acme-account-example-com" # config file content for certbot client [certbot.ini : <string> | default = ""] #NOTE: Eithermanaged_identity_idorsp_client_idandsp_client_secretmust be specified.NOTE:certbot.inirepresents theCERTBOT configuration fileand will be passed into certbot by theacme_dns_azurelibrary as defined. Misconfiguration will lead to failures of certbot and therefore of the renewal process.Following values will be added to the configurataion file by theacme_dns_azurelibrary per default:preferred-challenges: dns authenticator: dns-azure agree-tos: true[<eab>]# External account binding configuration for ACME, with key ID and base64encoded HMAC key [enabled: <boolean> | default = false] [kid_secret_name : <regex> | default="acme-eab-kid"] [hmac_key_secret_name : <secret> default="acme-eab-hmac-key"]certificates: - <certificate><certificate># Certbot certficate name. The name will also be used for Azure keyvault certificate name. name: <regex> # renewal in days before expiry for certificate to be renewed [renew_before_expiry: <int>] domains: - <domain><domain># domain name this certificate is valid for. Wildcard supported. name: <regex> # Azure resource ID to according record set within DNS Zone dns_zone_resource_id: <string>Manual running the libraryFor running the module as script 'sp_client_id' and 'sp_client_secret' are required. 'managed_identity_id' is not supported.# from config filepythonacme_dns_azure/client.py--config-file-path$CONFIG_File_PATH# from envpythonacme_dns_azure/client.py--config-env-var$ENV_VAR_NAME_CONTAINING_CONFIGPermission HandlingBest followsecurity recommendations from Azure.When working with shared DNS Zones, one can work with DNS delegation with limited permissions:Example:RecordNameValuePermissionTXT_acme-dedicated-DNS Zone ContributorCNAME_acme-challenge.mysubdomain_acme-dedicated.mydomainNoneThe CNAME and TXT record must be created upfront to enable users to use certbot. The permissions are required on the identity triggering certbot.With this setup, a DNS Zone owner can limit permissions and enable Users to Create/Renew certificates for their subdomain and ensuring that users cannot aquire certificates for other domains or interfer with existsing records.
acme-exercise
No description available on PyPI.
acme.hello
This is a test program for namespace_packages.How to use$python-macme.helloacme.hello
acme-ioet-orestes
No description available on PyPI.
acmekit
Failed to fetch description. HTTP Status Code: 404
acme-mgmtserver
ACME Management Server (ACMEMS)LetsEncryptsupports issuing free certificates by communication via ACME - the Automatically Certificate Management Evaluation protocol.This tools is yet another ACME client ... but as a client/server model.Why yet another ACME clientSome aspects are special:ACME handling can be put into own VM / container ...: The server can be placed into an own VM, container, network segment to limit the security risk on compromised systems.Only the server requires all the ACME dependencies: The clients require only a SSL tool like OpenSSL and a HTTP client like wget or curl, no python, no build tools. Python with python-acme and its dependencies (PyOpenSSL, Cryptography, ...) is only needed for the server.Supports distributed web servers: All.well-known/acme-challengesrequests for all domains can be served directly by the server. This makes it easy to validate domains when using multiple web server in distributed or fail-over fashion by forwarding all.well-known/acme-challengesrequests.Only the server needs the ACME account information: It is not that security relevant, but only the ACME Management Server needs access to the account information / key for the ACME server like LetsEncrypt.Caching CSR signs: The returned signed certificate of a CSR is cached until the certificate is nearly expired (per default two week). If two machines have manual shared a key and CSR and they reusing both, they will both get from ACMEMS the same certificate back.Domain Validations / Challenges.HTTP01The normal webserver must be adjusted to forward.well-known/acme-challengesrequests to the ACME Management Server - this is a prerequirement and will not be checked/enforced/configured by this tool.Nginxupstream acme-mgmtserver { server ...; } server { # ... location /.well-known/acme-challenge { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://acme-mgmtserver; # to support multiple acme mgmt server check challenge on all upstream server: proxy_next_upstream error timeout http_404; } # ... }This passes all ACME challenges to the management server.proxy_next_upstream http_404;can be used to support multiple ACME management servers and search for the response on all servers.ApacheUp to you - I am happy to accept a PR to complete this.TLSNI01TLSNI01is currently not supported, but there are few things are missing. Feel free to open a PR or talk to me if you have use for this challenge type.DNS01ACMEMS can instrument DNS servers to serve the neededTXTrecords to validate domain names viaDNS01challenge. The DNS servers will be updated vis DNS update. Currently there is no security for the updates implemented. We expect that the zone name managed by the name server are second-level domain name (likeexample.org).InstallationDebian PackagesMy preferred installation method are distribution packages. I try to published a packaged version in my ownPPA. To goal is to support the current LTS version and the previous version for a upgrade period. The software dependencies should be directly available as distribution packages.PyPIThe server and all its dependencies are available on PyPi and can be installed by Python package manager like pip e.g. inside a virtualenv.ConfigurationThe configuration is a basic INI file, with multiple key support. The main parts are the blocks to define the account directory, listen information for the http interfaces and the configuration which client is allowed to request certificates for which domains.[account]# the ACME server to talk to; I recommend to first test# against the staging systemacme-server=https://acme-staging.api.letsencrypt.org/directory# account dir; contains# account.pem - private key to identify against the ACME server# registration.json - the registration resource as JSON dumpdir=/etc/acmems/account/[mgmt]# Management interface itself, the clients needs to talk to thismgmt=192.0.2.13:1313# maximal size for CSR (in bytes)max-size=4k# define which verification block is used by defaultdefault-verification=http# should signed certificates be cached? if yes, how?default-storage=file# Define verification blocks[verification"http"]# the challenge type has to be defined first!type=http01# listen for HTTP challenge check requests (e.g. from Nginx)listener=192.0.2.80:1380listener=198.51.100.80:1380listener=[fe80::80%eth0]:1380[verification"dns"]# the challenge type has to be defined first!type=dns01-dnsUpdate# which name server needs to be updated nowdns-server=192.0.2.53# time-to-live for the new entriesttl=5# timeout for dns update requeststimeout=30# Storages[storage"none"]# this stores nothing and it is the default storagetype=none[storage"file"]# caching on disk, the directory must be writeable for the daemontype=filedirectory=/etc/acmems/storage# cached certificates will be treated outdated if their expire date is less# than $renew-within$ days away. A new certificate will be issued for the# passed CSR, stored and returned in subsequencial requests# defaults to 14 days - around 30 days is recommended by letsencryptrenew-within=14# Define multiple authentification blocks# a CSR must fulfil all listed authentication methods and must# only contains listed domains (checks against globs)[auth"mail"]# TCP connection must come from one of this IPsip=192.0.2.0/24ip=198.51.100.21domain=mail.example.orgdomain=mail.example.com# an additional auth block[auth"ext"]ip=198.51.100.128/28domain=*.test.example.org# CSR must also be signed by HMAC (via a the secret key)[auth"mail-secure"]# use special verification and storageverification=dnsstorage=fileip=198.51.100.21hmac_type=sha256hmac_key=A1YP67armNf3cBrecyJHdb035domain=mail?.example.orgdomain=mail.example.comRegistrationThe executableacme-registersupports to register at the ACME server. This will not be done automatically, you have to call it manually before the first use of the server itself.Please have a look at the help output for further instructionsacme-register --help.A registration could look like this:>bin/[email protected]/integration.ini Generateprivatekey...doneInitializeACMEclient...doneRegister...doneYouneedtoacceptthetermsofserviceathttp://127.0.0.1:4001/terms/v1 >bin/acme-register--accept-terms-of-service=http://127.0.0.1:4001/terms/v1configs/integration.ini Loadprivatekey...doneInitializeACMEclient...doneRefreshingcurrentregistration...doneYouneedtoacceptthetermsofserviceathttp://127.0.0.1:4001/terms/v1 AcceptingToSathttp://127.0.0.1:4001/terms/v1...doneExample Client Usage# generate domain private key (once!) openssl genrsa 4096 > domain.key # generate csr to create/renew your certificate # please generate a new csr for to renew your certificate openssl req -new -sha256 -key domain.key -subj "/CN=example.org" > domain-201512.csr # or openssl req -new -sha256 -key domain.key -subj "/CN=example.org" -reqexts SAN -config <(cat /etc/ssl/openssl.cnf <(printf "[SAN]\nsubjectAltName=DNS:example.org,DNS:www.example.org")) > domain-201512.csr # upload sign csr with shared key wget --post-file=domain-201512.csr --header="`openssl dgst -sha256 -hmac '$KEY' domain-201512.csr | sed -e 's/HMAC-\(.*\)(.*)= *\(.*\)/Authentication: hmac name=\L\1\E, hash=\2/'`" http://acmese:1313/sign > domain-201512.pem # upload csr with out sign wget --post-file=domain-201512.csr http://acmese:1313/sign > domain-201512.pemHTTP interfaceClient requestOnly POST requests to/signare supported.The body must be a CSR as PEM format;Content-Lengthheader is required,Content-Typeis currently not evaluated.To authentication the CSR via HMAC, add a header like:Authentication: hmac name=sha256 hash=47d5066525a214c759300d884bdd19d8f461a0ad24a2a0b7b705caee6c912228A complete request could look like:POST /sign HTTP/1.1 Host: 127.0.0.1:4005 Content-Length: 1586 Authentication: hmac name=sha256, hash=47d5066525a214c759300d884bdd19d8f461a0ad24a2a0b7b705caee6c912228 -----BEGIN CERTIFICATE REQUEST----- MIIEWjCCAkICAQAwFTETMBEGA1UEAwwKZ28uZHh0dC5kZTCCAiIwDQYJKoZIhvcN AQEBBQADggIPADCCAgoCggIBAOWXle7/dEo7l/h9O14w2ndsoKmzpHXcfosSyZnK qrMoJLSKQImm0Y0ACRggs+c4oTbGeyUgm44RmmPjBoFxdL41CHTp5YHOytaYQHUz A1wCitOzEMuPgRqvLUc4SqgjC7fOk1EP0bUX1YIrGNz40sYy5AsVINp4ZzKFfMoR KtGrx4j1OrkMOfQNV6f/P8wUyOzoSSN5/XUoxcQ44aeJcfeVY6jHqZtL4BDV3EDq oFnkHHKNGndYA6e0ov/WxHtXqxKrmsp7IN99sCvtwcoi8Kuf2OWE8/MuebsDRUCI fhCXCsGU+2+99qan70fL7o+VmZTwBGr3GHtjJ5+QthJ92oH6uXsS+AamyhyLpp1V 3CRi1BO2G746QCIDpMmnXHe4uV49igZsOX75kl8i4dpXkzMe4lvgj4jL2nftFYGy lv0LOwiiIUovRoTeVJlmD2RIgWz85MdxgHKFHpgBmgbmSoOlM1Uad4yY7WbsvtpT aoSjbuG6NGa77YJBZ8eAF0FEfhvYpEAN1+3pRtHWiGsHEZ0tbQU8bpy+hOXYCMkv iwpjyd+kTMBH9oCSeM3pQ8S74grpDV0L/wlfRoii2bImJDNurcRY22RJmPSQSSia 3KDHGZDzKW+uJs07FTa5y9RbavnCNQDrK6oyMMDZW876cQWHrj76U/f/8yuoeIuJ NdZtAgMBAAGgADANBgkqhkiG9w0BAQsFAAOCAgEAOK5sq1dtr8SxSxbhaib+b/hz F8F0xYpMBLrLpFfoAtoLWXp0a9AM3vqaHN+iPVTkwGri9c2Hi+E3VFltH39i+Ml1 U6I2KtiN1YB5/ARpQXCMT/29c31lPpvR3FfdKjOa078inacY+3bB7qwu3mC5qjrz ZzkJxMf5c7iQTWhp18ISD0zw2jN9I0OeyFZVfrQleGtlhVBSYemEyuurPu2vlwlq Xm0WpJ1wZlxNDolGTJ525HjIJEPJhGMnIwGSDKvN8INurfDzcPy1dUlRzxmoeRIs 23xu5D0DTfIPaMFT1yZaCF45nZLCcbNyUbbLK21+TABNwwAlm2UDz1RGsUK8h94x KeHJunfvtmQ7DB/Y7IfYkGJYt20RovuUniv/ruZtc8xPxcs3Sv8H93ISrKJ1ElmO Hvj45TYRjKC1Hl4YB30Yi/MQJJgN32Td48miTgyK5Sloc+v60CGWWsxfXC4zrUd9 CxzpbR5AeEOlsrjWBUJx3V1Ri5die1J+j0cutSC42BnFXkL3/W5JGpaiIpqlK1Ha jTC+FnojbcxDDW+SJpI3HI/Bzv3qAbMJS2WcyVGiN//sX5iuOW5r6fJECFQhCDzE 3f0YiD2Wh6N4xcf41bOVE7gA+TjmlShzSwZQPsEwUO4brRiBErnCbwpgK/T9vCV8 A3IlV6YS/4SoAHraTLA= -----END CERTIFICATE REQUEST-----Server responseError code:200: CSR was signed. Response body contains the certificate and the intermediate certificate in PEM form.403: Signing is denied, have a look at your auth blocks / authentication methods; are you missing anAuthenticationheader?413: CSR request is too long. You might increase themax-sizesetting.415: CSR could not be parsed.421: Challenge validation failed (temporarily)429: Rated limited (currently only based on ACME upstream errors)500: Internal exception - take a look at the log and report the bug.TestingThe server is tested by unit tests, integration tests against test ACME servers (BoulderandPebble) and with end-to-end tests. All major features should be covered like authentication, HTTP requests, validation methods (HTTP01, DNS01), different CSR and certificate algorithms (RSA and EC).The test are exectued bypy.test.docker-composeis used to run the ACME servers. Take a look attests/scriptsto inspect the commands, that are run on TravisCI.ContributingFork itCreate your feature branch (git checkout -b my-new-feature)Add tests for your feature.Add your feature.Commit your changes (git commit -am 'Add some feature')Push to the branch (git push origin my-new-feature)Create new Pull RequestLicenseGPL LicenseCopyright (c) 2015-2019, Malte Swart
acmen
AcmeNAcmeN is an ACME(RFC8555) client implemented in Python.Note:AcmeN is still under actively development, there will be some breaking changes until the first stable version v1.0.0 is released. Please keep an eye on the change log.Quick StartInstall AcmeN using pip:pipinstallacmenGenerate account key using openssl:opensslecparam-genkey-noout-namesecp384r1-outaccount.keyCreate a python file namedmain.pyas follows and modify necessary parameters:importloggingfromacmenimportAcmeNfromacmen.handlersimportCloudflareDnsHandlerlogging.basicConfig(level=logging.INFO)acme=AcmeN('account.key')handler=CloudflareDnsHandler('<your_api_token>')acme.register_account(contact=['mailto:[email protected]'])acme.get_cert_by_domain('example.com',['www.example.com','alt1.example.com'],handler)After a few seconds, you will get your certificate and key file in the working directory.For more information, please refer toAcmeN docs.(Chinese Simplified)
acmenewscollectors-pkg-rioatmadja2018
# DSC680: Acme News Collectors #This is a helper library to collect news articles, which includes news contents, video links, and images links; using Selenium Python library.###DependenciesSeleniumNumpyPandasPyMySQLBeautiful SoupPyTestChrome Driver###PhantomJS Installation- On Ubuntu 20.04 LTS machine, please installlibgconf-2-4- Go tohttps://phantomjs.org/download.htmland Download the latest phantomjs - Example: wgethttps://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2&& tar xvfj phantomjs-2.1.1-linux-x86_64.tar.bz2 - Copy or move to the desired location###Run Tests* pytest tests###Developer Info*[email protected]### License###MIT LicenseCopyright (c) 2020 Rio AtmadjaPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
acme-nginx
No description available on PyPI.
acmens
acmensA fork ofacme-nosudo. It uses ACMEv2 protocol and requires Python 3.acmensmay be used for getting a new SSL certificate, renewing a SSL certificate for a domain, and revoking a certificate for a domain.It's meant to be run locally from your computer.prerequisitesopenssl or libresslpython3pipvirtualenv (if you want to use the repo version)installationpipinstallacmensOr, if you would like to use the repo version:cd/path/to/acmens# init virtual environmentmakevenv# activate virtual environment..venv/bin/activate# put acmens in your PATHmakedevelop# note that any changes you make to acmens.py will be instantly reflected# in the acmens in your PATH.getting/renewing a certificateFirst, generate an user account key for Let's Encrypt:opensslgenrsa-aes2564096>user.key opensslrsa-inuser.key-pubout>user.pubNext, generate the domain key and a certificate request:# Generate domain keyopensslgenrsa-aes256-outdomain.key4096# Generate CSR for a single domainopensslreq-new-sha256-keydomain.key-outdomain.csr# Or Generate CSR for multiple domainsopensslreq-new-sha256-keydomain.key-subj"/"-addext"subjectAltName = DNS:example.com, DNS:www.example.com">domain.csrLastly, runacmens:acmens--account-keyuser.key--emailmail@example.com--csrdomain.csr>signed.crtdns challengeIf you want to use the DNS challenge type provide it using the--challengeflag.acmens--account-keyuser.key--emailmail@example.com--challengedns--csrdomain.csr>signed.crtThis will prompt you to update the DNS records to add a TXT record.revoking a certificateThis:acmens--revoke-kuser.key--crtsigned.crtwill revoke SSL certificate insigned.crt.
acmepy
acmepya simple acme client to generate certificates for Secure https DNS
acme-python-sdk
[email protected] is a sample server Petstore server. For this sample, you can use the api keyspecial-keyto test the authorization filters.RequirementsPython >=3.7Installingpipinstallacme-python-sdk==1.0.0Getting Startedfrompprintimportpprintfromacme_clientimportAcme,ApiExceptionacme=Acme(# Defining the host is optional and defaults to http://petstore.swagger.io/v2# See configuration.py for a list of all supported configuration parameters.host="http://petstore.swagger.io/v2",)try:# Pagination sandboxpaginate_response=acme.miscellaneous.paginate(first=1,# optionalafter="string_example",# optional)pprint(paginate_response.body)pprint(paginate_response.body["edges"])pprint(paginate_response.body["page_info"])pprint(paginate_response.headers)pprint(paginate_response.status)pprint(paginate_response.round_trip_time)exceptApiExceptionase:print("Exception when calling MiscellaneousApi.paginate:%s\n"%e)pprint(e.body)pprint(e.headers)pprint(e.status)pprint(e.reason)pprint(e.round_trip_time)Asyncasyncsupport is available by prependingato any method.importasynciofrompprintimportpprintfromacme_clientimportAcme,ApiExceptionacme=Acme(# Defining the host is optional and defaults to http://petstore.swagger.io/v2# See configuration.py for a list of all supported configuration parameters.host="http://petstore.swagger.io/v2",)asyncdefmain():try:# Pagination sandboxpaginate_response=awaitacme.miscellaneous.apaginate(first=1,# optionalafter="string_example",# optional)pprint(paginate_response.body)pprint(paginate_response.body["edges"])pprint(paginate_response.body["page_info"])pprint(paginate_response.headers)pprint(paginate_response.status)pprint(paginate_response.round_trip_time)exceptApiExceptionase:print("Exception when calling MiscellaneousApi.paginate:%s\n"%e)pprint(e.body)pprint(e.headers)pprint(e.status)pprint(e.reason)pprint(e.round_trip_time)asyncio.run(main())Documentation for API EndpointsAll URIs are relative tohttp://petstore.swagger.io/v2ClassMethodHTTP requestDescriptionMiscellaneousApipaginateget/paginationPagination sandboxPetApiaddpost/petAdd a new pet to the storePetApideletedelete/pet/{petId}Deletes a petPetApifind_by_statusget/pet/findByStatusFinds Pets by statusPetApifind_by_tagsget/pet/findByTagsFinds Pets by tagsPetApiget_by_idget/pet/{petId}Find pet by IDPetApiupdateput/petUpdate an existing petPetApiupdate_with_formpost/pet/{petId}Updates a pet in the store with form dataPetApiupload_imagepost/pet/{petId}/uploadImageuploads an imageStoreApidelete_orderdelete/store/order/{orderId}Delete purchase order by IDStoreApiget_inventoryget/store/inventoryReturns pet inventories by statusStoreApiget_order_by_idget/store/order/{orderId}Find purchase order by IDStoreApiplace_orderpost/store/orderPlace an order for a petUserApicreatepost/userCreate userUserApicreate_with_arraypost/user/createWithArrayCreates list of users with given input arrayUserApicreate_with_listpost/user/createWithListCreates list of users with given input arrayUserApideletedelete/user/{username}Delete userUserApiget_by_nameget/user/{username}Get user by user nameUserApiloginget/user/loginLogs user into the systemUserApilogoutget/user/logoutLogs out current logged in user sessionUserApiupdateput/user/{username}Updated userDocumentation For ModelsApiResponseCategoryCreateWithArrayRequestFindByStatus200ResponseFindByStatusResponseFindByTags200ResponseFindByTagsResponseGetInventoryResponseLogin200ResponseLoginResponseOrderPaginateRequestPaginateResponsePetTagUpdateWithFormRequestUploadImageRequestUserUserCreateRequestAuthorThis Python package is automatically generated byKonfig
acme-rofl
ACME ROFLACME Respond Or Forward ListenerThis simple listener does two things:Respond to http requests for files in the .well-known directoryForward all other requests via 301 Moved Permanently, redirecting to the same URL but using https.Leave it running. Run certbot periodically.SystemdThere's a systemd service that you might want to enable. If you installed this via pip, you'll find/usr/local/share/acme-rofl/acme-rofl.service. Symlink that wherever your systemd scripts live. On Debian that could be one of several places, and one of them is/etc/systemd/system.Then, tell systemd there's a new script:systemctl daemon-reload
acme.sql
UNKNOWN
ac-messager
UNKNOWN
acme-test-01
This is just a test to try all the flow of creatinig a library and publishing it.
acme-tiny
No description available on PyPI.
acmetk
ACME ToolkitACMEtk's main objective is the integration of Let's Encrypt-like services into large decentralized networks by means of a centrally hosted service that operates like a standard ACME CA on the client-facing side, but relays ACME messages regarding certificate issuances to a specified external CA.PyPI:https://pypi.org/project/acmetk/Docs:https://acmetk.readthedocs.io/
acm-hamburg-legacy
acm-hamburg-legacyLegacy code used by comp3d NERDD modules.Installationpip install -U acm-hamburg-legacyContributorsConrad StorkAnke WilmSteffen HirteAxinya Tokareva
acmhelper
AcmHelper本地环境下的 Polygon , 但不止于 Polygon.你可以快速创建具有合理结构的题目文件夹指定std,checker,validator,interactor使用不同语言完成不同部分 (cpp/py)使用额外的程序来测试数据的质量使用预制的数据生成器快速生成具有某些特征的数据同时使用多种数据生成器 , 并可以指定每个程序所接受的生成器享受由rich,typer带来的美丽TODO使helper sys run可以执行save下的数据添加对Validator和Interactor的支持根据hash动态选择是否编译简易使用说明得益于typer, 关于题目生成的功能都可以通过输入helper --help大致了解安装pip install acmhelper你需要具有全局的g++, 默认使用-std=c++17编译, 可在设置修改快速从数据文件得到渲染的图如果想要使用图的渲染功能 , 你需要下载 Graphviz 的二进制文件并且将其加入 Path对于形式为n m (optional) u1 v1 w1 (w1 is optional) ... un vn wn的数据 , 可以使用helper render来快速渲染首先创建文件test.in, 写入一个不连通的DAG5 2 1 2 3 1 3 5 1 5 -7在该文件目录下输入helper render -dic test.in查看test.png, 应该如下所示具体的设置请使用helper render --help查看创建一道题目(以 "输出一个绝对值小于输入数字绝对值的整数"为例(int范围内))首先新建文件夹Problem, 然后在此文件夹下打开命令行 , 输入helper sys init, 回答问题 , 完成初始化如果初始化正确的话你的目录结构应该向下面的一样(部分文件可能没有 , 这需要我们后续手动创建)题目目录结构 - Problem - config.json - std.cpp/py - testlib.h (optional) - checker.cpp/py (optional with "testlib.h") - interactor.cpp (optional with "testlib.h") (Not implemented) - validator.cpp (optional with "testlib.h") (Not implemented) - generator - make1.cpp - make2.py - accept - ac1.cpp - ac2.py - wrong - wa1.cpp - wa2.py - exec - something executable... - data - auto - in - 1.make1.in - 2.make2.in - out - 1.ac1.out - 1.wa1.out - save - in - 1.make1.in - 2.make2.in - out - 1.ac1.out - 1.wa1.out - log - 20220303.log - temp - someting temporary... - output - something...然后打开std.cpp, 写入以下代码#include<bits/stdc++.h>usingnamespacestd;intmain(){inta;cin>>a;cout<<abs(a)/2<<'\n';return0;}保存后 , 我们来写第一个数据生成器make1.py, 它只用来生成大于0的数.在generator下创建文件make1.py, 写入以下代码fromrandomimportrandintprint(randint(1,1000))接下来只需要修改一些配置 , 就可以通过CLI来生成数据了打开文件config.json, 将如下代码复制{"gen_list":["make1"],"accept_list":[],"wrong_list":[],"gen_link_code":{"make1":["std"]},"gen_data_num":{"make1":10},"time_limit":2,"max_time_limit":10,"std":"std","checker":"checker","interactor":"","validator":"","gcc_version"17}这个文件描述的含义是 , 有一个生成器make1, 其生成 10 组数据 , 生成的数据被用来运行std, 没有额外的理论错误和理论正确的代码 ,Time_Limit_Exceed的上界是2s, 程序被 kill 掉的上界是10s, std 的辨识名称为std, checker 的辨识名称为checker, 没有使用interactor和validator, 使用-std=c++17编译保存后 , 输入helper sys run, 你应该能看到我们暂时性的成功接下来 , 我们来添加额外的生成器,测试代码和checker来完善这道题在wrong下创建wa1.cpp和wa2.py, 然后写入下述代码#include<bits/stdc++.h>usingnamespacestd;intmain(){inta;cin>>a;cout<<a-1<<'\n';return0;}n=int(input())print(n+1)在accept下创建ac1.cpp写入如下代码#include<bits/stdc++.h>usingnamespacestd;intmain(){inta;cin>>a;if(a>=0){cout<<a-1<<'\n';}else{cout<<a+1<<'\n';}return0;}可以发现 ,wrong下的两个代码分别会在a<0和a>0时出错 , 所以我们再新建一个生成器在generator下创建make2.py写入如下代码 , 注意负号fromrandomimportrandintprint(-randint(1,1000))可以发现这道题需要checker, 打开checker.cpp, 写入如下代码#include<bits/stdc++.h>#include"testlib.h"usingnamespacestd;intmain(intargc,char**argv){registerTestlibCmd(argc,argv);// Requiredintn=inf.readInt();intm=ouf.readInt();if(abs(m)<abs(n)){quitf(_ok,"Correct!");}else{quitf(_wa,"Wrong Answer!");}}最后我们再修改一下config.json{"gen_list":["make1","make2"],"accept_list":["ac1"],"wrong_list":["wa1","wa2"],"gen_link_code":{"make1":["std","ac1","wa1","wa2"],"make2":["std","ac1","wa1","wa2"]},"gen_data_num":{"make1":10,"make2":10},"time_limit":2,"max_time_limit":10,"std":"std","checker":"checker","interactor":"","validator":"","gcc_version":17}最后输入helper sys run, 完成了.如果字体和终端合适 , 你应该会看到像这样的东西不出意料地 , 两个不对的程序在合适的地方不对了.作为结尾 , 我们来使用CLI打包数据以及checker输入helper sys add 1 2 3 4 5 6 7 8 9 10, 这样我们就将前10组输入数据和std的输出数据从auto移动到了save下 , 值得注意的是 , 数据的编号会自动地递增 , 所以不用担心数据覆盖问题然后输入helper sys output checker.cc, 查看output文件夹下 , 你应该可以看到名为data.zip的文件 , 其中的所有文件都被合适的重命名了 , 特殊的 ,checker被重命名为了checker.cc更细节的使用请参考helper sys --help,helper sys add --help等
acmiel-demo-package
Demo package to show why setup.py is scary.
acml
ACMLAdvanced Config Markup LanguageExplore the docs »PyPi·Report Bug·Request FeatureTable of ContentsAbout The ProjectBuilt WithGetting StartedInstallationUsageRoadmapContributingLicenseContactAcknowledgmentsAbout The ProjectACML is a custom markup language designed for creating complex configuration files with nested sections and key-value pairs. It allows users to organize their configuration data into different subsections, making it easy to manage and modify large configuration files.Here's why:With ACML, you can easily define subsections using the [section.subsection] syntax, and populate them with any number of key-value pairs. These key-value pairs can be simple strings, integers, floats, lists, and even JSON-style dictionaries.Of course, no one configuration format will serve all projects since your needs may be different. So I'll be adding more in the near future. You may also suggest changes by forking this repo and creating a pull request or opening an issue.Built WithACML is purely built off of Python, we chose Python for its flexibility and easy grammar so more people can contribute.(back to top)Getting StartedWe are hosted onPyPi, so you can sit back and relax by usingpip.InstallationBelow is an example of how you can instruct your audience on installing and setting up your app. This template doesn't rely on any external dependencies or services.Download Python and PIPOpen a command promptRun the following command:pip install ACML- This may work on most systemspy -m pip install ACML- Works 100% of the time on Windows 10+pip3 install ACML- Linux Distros(back to top)UsagefromACMLimport*config=parse("path/to/config.conf/")config["key"]["key2"]For more examples, please refer to theDocumentation(back to top)RoadmapAdd ParserAdd Read MeAdd LicenseAdd multiple config formatsAdd more testsSee theopen issuesfor a full list of proposed features (and known issues).(back to top)ContributingContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make aregreatly appreciated.If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!Fork the ProjectCreate your Feature Branch (git checkout -b feature/AmazingFeature)Commit your Changes (git commit -m 'Add some AmazingFeature')Push to the Branch (git push origin feature/AmazingFeature)Open a Pull Request(back to top)LicenseDistributed under the MIT License. SeeLICENSEfor more information.(back to top)ContactBrody Critchlow -thornily#6566Project Link:https://github.com/brodycritchlow/ACML(back to top)AcknowledgmentsUse this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!Readme Template(back to top)
acmp-utils
acmp_utilsTheacmp_utilsis a power packed utils repository to be used by ACMP teams for day to day development.Install & UsageYou can installacmp_utilsas follows to latest version:pip install acmp_utils --upgradeSpecific version:pip install acmp_utils==<version> --upgradeTo remove:pip uninstall acmp_utilsTry to have fun withacmp_utils:from multiply.by_three import multiply_by_three from divide.by_three import divide_by_three multiply_by_three(9) divide_by_three(21)Useful ResourcesPackaging Python Projects¶Configuring setuptools using setup.cfg filesMIT LicenseCopyright (c) 2023 Pradeepta DindaPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
acm-sdk-python
No description available on PyPI.
acmsimulator
UNKNOWN
acmtrans
No description available on PyPI.
acmturtleoj
OJ Client for Python3 Turtle一、当遇到questype=9的题型时,需要访问(GET):https://myproxy.acmcoder.com:4443/run如果返回:{result: "pong"}则表示客户端已经启动。否则:提示:请按照如下步骤启动客户端: 1、安装Python3 2、打开命令行,输入:pip3 install --upgrade acmturtleoj && python -c "import acmturtleoj;acmturtleoj.main()" 3、回车,当360提示是否阻止该操作时,一定要选允许该操作 4、保持窗口不关闭 5、切换到考试界面继续答题。二、往后端提交完代码后,需要访问(GET):https://myproxy.acmcoder.com:4443/run?user_id=abc&guid=def&solution_id=3其中: user_id:考生端为Cands.id;报告端为生成的guid; guid:考生端为Cands.guid;报告端为生成的guid; solution_id:考生端如果有,则加上,如果没有,则为0;报告端为solutionId。 如果成功,则返回:{result: "ok"}
acn
Failed to fetch description. HTTP Status Code: 404
acnawebcli
Welcome to cli-toolsThis is a Python library for testingInstallationacnawebclisupports Python 3.8 and higher.System-wide or user-wide installation with pipxUse the package managerpipto installacnawebcli.$pipinstallacnawebcliUsageDevelopingDevelopment requires Python 3.8+; otherwise you'll get false positive type failures.To work on theacnawebclicode: pull the repository, create and activate a virtualenv, then run:makedevTestingmaketestPublishmakepushAuthor👤Antonio Carlos de Lima JuniorWebsite:https://www.linkedin.com/in/acnaweb/Github:@acnawebLinkedIn:@acnawebReferencesPypi ClassifiersPython Packaging TutorialA Practical Guide to Using Setup.py
acnaweblib
Welcome to acnaweblibThis is a Python library for testingInstallationacnaweblibsupports Python 3.8 and higher.System-wide or user-wide installation with pipxUse the package managerpipto installacnaweblib.$pipinstallacnaweblibUsagefromacnaweblibimportcalculator# returns 6result=calculator.add(4,2)DevelopingDevelopment requires Python 3.8+; otherwise you'll get false positive type failures.To work on theacnaweblibcode: pull the repository, create and activate a virtualenv, then run:makedevTestingmaketestPublishmakepushAuthor👤Antonio Carlos de Lima JuniorWebsite:https://www.linkedin.com/in/acnaweb/Github:@acnawebLinkedIn:@acnawebReferencesPypi ClassifiersPython Packaging TutorialA Practical Guide to Using Setup.py
acnestis
Acnestis - collect, aggregate and convertA very simple tool that allows you collect data from different sources, change it ia different waysInstall$pipinstallacnestisYou can do in declarative wayconvert data in the current folderaggregate data from different sourcesinheritence - when you collect data from different source - you can replace any file and those files will be used in the child repoOk, this is confusing. Show me some examplefirst of all, you can find some examples in thetests/datafolder(source folders, or from-folders, may contain both yaml and py files, that doesn't mean both are required. We just make alternatives for testing and illustration)Acnestis declorationin order to declarate folder as acnestis folder you should do one of the followingcreate.acnestis.yamlfile in that foldercreate.acnestis.pyfile in that folder. Py-file has an identical functionality, but some more power (of course)create both.asnestis.yamland.acnestis.py- in that case yaml-file will be used as the main one, but can use declared global variables from the py-filedeclarate some of the sub-folders (even non-existed), in the current acnestis-declorationIn order to process acnestis folders - you should do$acnestingprocessfrom/folderto/folderif no acnestis decloration in thefrom/folderit will just copy files toto/folder. iffrom/folderhas at least one acnestis decloration - it will be used for processing that folder, the rest will be copiedSimple convertionFrom:tests/data/002_concat_poemto:tests/data/002_concat_poem_resultthis is a very simple example, where all files from folder poem.txt will be connected into a single filewe declaratepoem.txtfolder as acnestis folderPy version:fromacnestis.processingimportProcessorfromacnestis.stepsimportconcat_filesPROCESSOR=Processor([concat_files("poem.txt")],as_file="poem.txt")YAML version:steps:-name:concat_filesinto_file:poem.txtas_file:poem.txtIt has one single stepconcat_fileswith attributeinto_file: poem.txt- so it simply concat all the files into oneAlso processing has attributeas_filemeans the folder will be replaced with one filepoem.txtDocker for more complex convertion*Fromtests/data/006_docker_svgoto:tests/data/006_docker_svgo_resultyou can build own convertion tools using dockerPy version:fromacnestis.processingimportProcessorfromacnestis.stepsimportdockerPROCESSOR=Processor([docker("acnestis_svgo",skip_pull=True)],)YAML version:steps:-name:dockerimage:acnestis_svgoskip_pull:trueone single step of using docker imageacnestis_svgofor processing acnestis folder.Dockerfile of acnestis_svgois very simple:# Base imageFROMnode:20-alpine# Install SVGORUNnpminstall-gsvgo# Execute the SVGO command when the container startsENTRYPOINT["svgo","-f","/data_input","-o","/data_output"]you can use simple python-code for convertionFromtests/data/004_codetotests/data/004_code_resultNow let's play with aggregation.we want not only convert data, but first collect it from different sourcesFor the testing and examples we will useoduvan/acnestis-test-repogithub repository and its branches.simple use of git-repoFrom:data/007_gittodata/007_git_resultas any folders in the given repo are declarated as acnestis - we will see a simple copy files from the repoPy version:fromacnestis.processingimportProcessorfromacnestis.stepsimportgitPROCESSOR=Processor([git("https://github.com/oduvan/acnestis-test-repo.git",branch="main")],)YAML version:steps:-name:giturl:https://github.com/oduvan/acnestis-test-repo.gitbranch:maininjection in the childFrom:tests/data/008_git_processingto:tests/data/008_git_processing_resultYAML version:steps:-name:giturl:https://github.com/oduvan/acnestis-test-repo.gitis very simple, but the master branch of the repo contains an acnestis-folder, which means it will be processed after checkout into the current one.During the checkoutpoem.txtfolder will be created and all of the files in the folder will be connectedbut in the current repo we created a folder poem.txt with file3.txtso that file become a part of processing processMore complex examples:for more example checktests/datafolder009_git_subfolder- we don't need all of the files from the git repo, but only specific folder010_subprocess_git- we declarate a specific acnestis folder for processing011_sub_git_copy- using of copy and rm steps013_simple_aggregateand014_aggregate_two_poems- more complex aggregation examples
acng
No description available on PyPI.
acnh
No description available on PyPI.
acni
Anticorrelated Noise InjectionA Jax/Optax implementation ofAnticorrelated Noise Injection for Improved Generalization
acnportal
ACN PortalThe ACN Portal is a suite of research tools developed at Caltech to accelerate the pace of large-scale EV charging research. Checkout the documentation athttps://acnportal.readthedocs.io/en/latest/.For more information about the ACN Portal and EV reasearch at Caltech check outhttps://ev.caltech.edu.ACN-DataThe ACN-Data Dataset is a collection of EV charging sessions collected at Caltech and NASA's Jet Propulsion Laboratory (JPL). This basic Python client simplifies the process of pulling data from his dataset via its public API.ACN-SimACN-Sim is a simulation environment for large-scale EV charging algorithms. It interfaces with ACN-Data to provide access to realistic test cases based on actual user behavior.algorithmsalgorithms is a package of common EV charging algorithms which can be used for comparison when evaluating new algorithms.This package is intended to be populated by the community. If you have a promising EV charging algorithm, please implement it as a subclass of BasicAlgorithm and send a pull request.InstallationDownload or clone this repository. Navigate to its root directory. Install using pip.pipinstall.TutorialsSee thetutorialsdirectory for jupyter notebooks that you can run to learn some of the functionality ofacnportal. These tutorials are also included on the readthedocs page. Additional demos and case studies can be found athttps://github.com/caltech-netlab/acnportal-experimentsWe also have a video series ofacnportaldemos, which can be found at TODO.Running TestsTests may be run after installation by executingpython-munittestdiscover-vRemove-vafterdiscoverto suppress verbose output.ContributingIf you're submitting a bug report, feature request, question, or documentation suggestion, please submit the issue through Github and follow the templates outlined there.If you are contributing code to the project, please view the contributing guidelineshere.QuestionsContact the ACN Research Portal team atmailto:[email protected] any questions, or submit a question through Github issues.
acnutils
A collection of various scripts used by AntiCompositeNumber’s bots.Feel free to use this if you find it useful, however, no guarentees of stability are made. Pull requests are welcome, but may be declined if they would not be useful for my bots or tools.This package depends on pywikibot. Some utilites also require a database connection via the toolforge libarary, to enable those installacnutils[db].Poetry is used for dependency management and package building. To set up this project, runpoetry install-Edb.
aco
Ant Colony OptimizationImplementation of the Ant Colony Optimization algorithm in PythonCurrently works on 2D Cartesian coordinate systemInstallationFrom PyPipipinstallacoUsingPoetrypoetryaddacoUsageAntColony(nodes,start=None,ant_count=300,alpha=0.5,beta=1.2,pheromone_evaporation_rate=0.40,pheromone_constant=1000.0,iterations=300,)Travelling Salesman Problemimportmatplotlib.pyplotaspltimportrandomfromacoimportAntColonyplt.style.use("dark_background")COORDS=((20,52),(43,50),(20,84),(70,65),(29,90),(87,83),(73,23),)defrandom_coord():r=random.randint(0,len(COORDS))returnrdefplot_nodes(w=12,h=8):forx,yinCOORDS:plt.plot(x,y,"g.",markersize=15)plt.axis("off")fig=plt.gcf()fig.set_size_inches([w,h])defplot_all_edges():paths=((a,b)forainCOORDSforbinCOORDS)fora,binpaths:plt.plot((a[0],b[0]),(a[1],b[1]))plot_nodes()colony=AntColony(COORDS,ant_count=300,iterations=300)optimal_nodes=colony.get_path()foriinrange(len(optimal_nodes)-1):plt.plot((optimal_nodes[i][0],optimal_nodes[i+1][0]),(optimal_nodes[i][1],optimal_nodes[i+1][1]),)plt.show()ReferenceWikipediapjmattingly/ant-colony-optimization
aco2sass
aco2sassis a small python script which converts photoshop.acoswatch files to a list of the corresponding swatch colors formatted as SASS varibles.The implementation is based on the file format specified byAdobehere:https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577411_pgfId-1055819
acoewidgets
ACOE Custom Jupyter Widget Library
acollections
UNKNOWN
acolytegm
No description available on PyPI.
acomm
No description available on PyPI.
acomms
===========pyAcomms===========pyAcomms provides a Python interface to Micromodem and Micromodem-2 hardware from the`Acoustic Communications Group <http://acomms.whoi.edu/>`_ at the `Woods Hole Oceanographic Institution <http://www.whoi.edu/>`_.See examples in the ``/examples`` and ``/bin`` directories.
acomod
Acoustic Modes ViewerThis program is a simple viewer of power spectral density of sounds recorded either from microphone or played from .wav files. The package provides a module and a program to trace Fourier acoustic modes and resonance frequencies of excited bodies.Use casesestimate length of an excited metal bar, ormeasure frequency of flute tones,identify resonance frequencies and through provided sound speed the corresponding length scales of mechanical components that generate unwanted resonances (e.g. in a car as a function of speed cs)test 1/f noise and microphonic effects in electrical devices the program runs on.FeaturesAnalysis of sound from microphone or from a file (WAV format)In order to analyze transient signals, the program keeps track of peaks detected in the instantaneous power spectraSaves recorded and processed data to files for further analysisOutputs list of peak frequencies (f) and associated wavelengths (l=cs/f)InstallationVirtualenv installation with pippython3-mvenvvenvsourcevenv/bin/activate pipinstallacomodFrom sources (Ubuntu 20.04 LTS)sudoaptinstalllibportaudio2/focal python3-mvenvvenvsourcevenv/bin/activate gitclonehttps://github.com/bslew/acomod.gitcdacomod pipinstall-rrequirements.txt pythonsetup.pybuild pythonsetup.pyinstallRunacoustic_mode_viewerNoteYou may need to specify the LD_LIBRARY_PATH environment variable to point to the location where appropriate Qt libraries can be found. Let's store these settings in your virtual environment activaton script.$echo'LD_LIBRARY_PATH='`find"$VIRTUAL_ENV"-name"*libQt5Core.so.5*"-execdirname"{}"\;`:$LD_LIBRARY_PATH>>venv/bin/activateScreenshotsExamplesLoading and playing wav filesThe program comes with a set of examples stored in "data" folder. After starting the program just go to: File>Open File... (or Ctrl-o), go to src/acomod/data/ and select a wav file. Press play (or Ctrl-p) to start calculating and plotting power spectra on sections of the wav file of length specified in the "Record Length" box. (The sound is not played). Peaks for each partial spectra can also be shown as specified by Npeaks window. The maximal values in each mode can also be over-plotted in red (View>Plot Maximal Values, or Ctrl-m). If the wav file length fits within the recording length the two plots are be identical. Similarly, the average spectrum can be toggled by pressing Ctrl-a.Press "Play" again (ctrl-p) to stop/start calculating power spectrum in the background.Browsing the modesUse left or right arrows to loop over Npeaks modes in the power spectra and check their respective frequencies (and corresponding wavelengths). You may need to focus on the plot window first (Ctrl-g).Toggling axesUse Ctrl-l and Ctrl-k to toggle between logarithmic and linear axes.Recording new dataNew sounds can be recorded by pressing Crtl-r. The recording can be latter saved as wav file. As in case of "playing" mode, the spectra are calculated using recording lengths as specified in the "Record Length" box and the plots are updated on every newly calculated spectra.Troubleshootingacoustic_mode_viewer gives core dump on startWhen you pip3 install acomod in virtual environment or locally via --user option Qt platform plugin may fail to be properly initialized due to incorrect configuration of LD_LIBRARY_PATH environment variable (under Linux) and pointing locations of Qt libraries installed most likely somewhere in the system directories. If the version of those is not the one required by the PyQt5 the program will fail with"This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.",a message that typically is not even printed out to the terminal.Solution: Provide the correct path to the Qt shared libraries: e.g.$exportLD_LIBRARY_PATH=`find./venv-name"*libQt5Core.so.5*"-execdirname'{}'\;`:$LD_LIBRARY_PATHor in case ofpip install acomod --user$exportLD_LIBRARY_PATH=`find$HOME/.local-name"*libQt5Core.so.5*"-execdirname'{}'\;`:$LD_LIBRARY_PATHAuthorsBartosz Lew ([email protected])
acondbs
AcondbsProductDB back-end APIHow to check out and run (for developers)Prepare environmentCreate a virtual environmentpython-mvenvvenvEnter the virtual environmentsourcevenv/bin/activateUpgrade pip (optional)pipinstall--upgradepipCheck outClone the repository from [email protected]:simonsobs/acondbs.gitInstall from the clone in theeditable mode.pipinstall-eacondbs/[tests]ConfigureCreate an instance folder of Flask, where the config file and the SQLite DB file are stored. Check out an example instance folder from [email protected]:TaiSakuma/acondbs-instance-example.gitinstanceSet environmental variablesexportFLASK_APP="acondbs:create_app('$PWD/instance/config.py')"exportFLASK_DEBUG=1Initialize databaseflaskinit-dbAn SQLite DB file has been created in the instance folder (instance/product.sqlite3). Tables were defined (The tables were empty. Only fields were defined. No data were inserted in the tables).Load sample data to DB (optional)(Optional) Load sample data to the dababase.flaskimport-csvacondbs/tests/sample/csv/RunRun with the Flask built-in server for the development. (Deployment options for proudction are descriped in theFlask documentation.)flaskrunThe above command starts the built-in server that only allows accress from localhost. It starts the server at the default TCP port, usually5000.To allow the access from outside, use--host=0.0.0.0option. The TCP port can be specified by--portoption. For example:flaskrun--host=0.0.0.0--port=5000Access to the server with cURLNow, you can send GraphQL requests to the server, for example, as follows.curl-d"query={allMaps { edges { node { name mapper } } }}"localhost:5000/graphqlAccess to the server with a web browserIf you access to the server with a web browser, it will show a graphical user interfaceGraphiQL:http://localhost:5000/graphqlUnit testMove to the repositorycdacondbsRun the unit testspytestRun the unit tests with coveragepytest--covGenerate the coverage reportcoveragehtmlThe report can be found atcoverage_html_report/index.html.
aconf
🤖 Auto ConfigMemory-based global configuration for Python projects -- in 10 lines of code (including empty lines). Made with the intention of ridding the need to passConfigobjects everywhere. Option to usenamedtupledif wanted.Installingpip install aconfWhy?Honestly? Because why not. Was tired of having to passConfigobjects left and right in small personal projects, so created this.UsingThis module comes with three main functions:make_config(**kwargs): Creates the configuration in memory.config(): Loads configuration from memory as standard dictionary.conf(): Loads configuration from memory as namedtuple object for cleaner access.fromaconfimportmake_config,config,conf# Creates a global configuration that can be accessed by any other portion of the runtime.make_config(database={"user":"admin","password":"db_password","host":"localhost","port":"3306"},method="GET")# Accessing the global configuration as a dictionary.print(config()['database']['user'])# >>> admin# Accessing the global configuration as a namedtuple object.print(conf().database.user)# >>> adminA single file example doesn't encapsulate the usefulness of this module. Instead, imagine the following project:. ├── project │ ├── __init__.py │ ├── config.py │ └── functionality.py └── main.pyconfig.py""" 'Config' class to hold our desired configuration parameters.Note:This is technically not needed. We do this so that the user knows what he/she should passas a config for the specific project. Note how we also take in a function object - this isto demonstrate that one can have absolutely any type in the global config and is not subjectedto any limitations."""fromaconfimportmake_configclassConfig:def__init__(self,arg,func):make_config(arg=arg,func=func)functionality.py""" Use of the global configuration through the `conf` function. """fromaconfimportconfclassExample:def__init__(self):func=conf().funcarg=conf().argself.arg=func(arg)main.pyfromproject.configimportConfigfromproject.functionalityimportExample# Random function to demonstrate we can pass _anything_ to 'make_config' inside 'Config'.defuppercase(words):returnwords.upper()# We create our custom configuration without saving it.Config(arg="hello world",func=uppercase)# We initialize our Example object without passing the 'Config' object to it.example=Example()print(example.arg)# >>> "HELLO WORLD"PerformanceAbsolutely no idea. I wrote this for small projects that I don't intend on releasing and so I have not bothered to benchmark it. If anyone runs the number it would be lovely if you reported either as an Issue, or directly by shooting a pull request with this portion of theREADME.mdupdated. The project in essence does the following:make_config(**kwargs): Pickles thekwargsdictionary and saves it to memory.config(): Loads the pickled dictionary from memory.conf(): Loads the pickled dictionary from memory and transforms it intonamedtuple.It would be reasonable to assumeconf()performance is slower thanconfig(). If I had to assume the largest performance drop is within the dumping and loading of pickled objects (even if from memory).ProjectThis is the entirety of the project, which is inside__init__.py. Usesnamedtuple:importnamedtupleddefmake_config(**kwargs):globals()["aconf"]=kwargsconf=lambda:namedtupled.map(globals()["aconf"])config=lambda:globals()["aconf"]
aconfig
No description available on PyPI.
aconnect
No description available on PyPI.
acons
ACONSAn asynchronous command-line runner for use in async web-servers likefastapi.Sometimes, you want to run command-line utilities and expose the output to a web-server. However, it's a bit tricky to capture the console output while it's running, and also allow the web-client to kill the job mid-process.aconscan execute command-line processes as an async function, where output can be retrieved via another async function, and a kill signal can be sent at any time.Installpip install aconsrunFunction interface:run(command, run_dir=None, is_parse=False, job_id=None)command: str of command-line commandrun_dir: optional starting directory of the commandis_parse: optional flag to parse the output as tsv file into a list of dictionariesjob_id: optional id that will be used toflush_linesandkill_jobTo use in an async function:await acons.run('ls', job_id='my-special-id-123')To test the output in a sync version:import acons output = acons.sync_run('ls')flush_linesIn an async function:lines = await acons.flush_lines('my-special-id-123')This will return the console lines produced by the job since the last call toacons.flush_lineskill_jobIn an async function:`await kill_job('my-special-id-123')Sends the kill signal for the job.Parameters dacons.RUN_INTERVAL_IN_S = 0.2- determines how long the function polls for each intervalacons.SLEEP_INTERVAL_IN_S = 0.5- determines how long the function sleeps between intervalsacons.N_MAX_JOB = 100- maximum number of jobs that stores output using an LRU cacheExample serverA simple fastapi-server/vue-client is included that demonstratesaconsin action.Concurrent command-line commands can be typed in and executed. The console output will be piped back into the web-client, and the job can be cancelled at any time.When the job is completed, the entire console output is made available through the Monaco web-editor .Download the .zip version of this package, then run the server:./test-server.shwhich is essentially:uvicorn server:app --reload --port=5200Communication between client/server is via an rpc-json interface as described inrpcseed.
aconsole
aconsoleAsynchorous Commandline like GUI for Python 3.Provides async await for print and input. It also supports having multiple awaiting inputs, which are queued and then processed one by one. See:Multiple inputs awaiting.Other supported features:Canceling input.Changing color themeChaging transparencyControlsMouse for navigating the output. Keys for input:[Enter] Submits input. [Up/Down] Navigates input history.Keys for output:[Ctrl+C] Copy selected content. [Ctrl+R] Clears output.DepenciesJust Python 3.6 or above. For GUI it uses Tkinter, which is built-in module in Python.Tested on: Mac, Linux and Windows.A Simple Exampleimportasyncioimportaconsoleif__name__=='__main__':loop=asyncio.get_event_loop()console=AsyncConsole()console.title('echo test')asyncdefecho():whileTrue:result=awaitconsole.input('echo to out: ')console.print('echo:',result)run_task=console.run(loop)loop.create_task(echo())loop.run_until_complete(run_task)# wait until window closedOther ExamplesAsync Chat ClientAsync Chat ServerSimple Math GameSimple asking programSimple asking program using sqlMultiple inputs awaiting
aconsole-pkg-minad
No description available on PyPI.
acoomans_python_project_template
My Python Project=================[![Build](https://travis-ci.com/acoomans/python_project_template.svg?branch=master)](https://travis-ci.org/acoomans/python_project_template)[![Pypi version](http://img.shields.io/pypi/v/acoomans_python_project_template.svg)](https://pypi.python.org/pypi/acoomans_python_project_template)[![Pypi license](http://img.shields.io/pypi/l/acoomans_python_project_template.svg)](https://pypi.python.org/pypi/acoomans_python_project_template)![Python 2](http://img.shields.io/badge/python-2-blue.svg)![Python 3](http://img.shields.io/badge/python-3-blue.svg)Run tests:python setup.py test[distutils]index-servers =pypipypitest[pypi]repository=https://pypi.python.org/pypiusername=acoomans[pypitest]repository=https://testpypi.python.org/pypiusername=acoomans
acopoweropt
Ant Colony Power Systems OptimizerThis library aims to provide a tool to obtain an optimal dispach of a Power System comprised of Thermal Generation Units. The approach combines the Ant Colony Optimizer with a non-linear solver provided by CVXOPT.This is an under development libraryInstallation instructionsPyPiA pre-built binary wheel package can be installed using pip:pipinstallacopoweroptPoetryPoetry is a tool for dependency management and packaging in Python.acopoweroptcan be installed in a poetry managed project:poetryaddacopoweroptUsageFrom a domain perspective, there should be a complete decoupling between an Ant Colony and a Power System, after all ants do not have knowledge of power systems. This approach, although more elegant, is far from trivial to be implemented, mainly because theenviromentwhere the ants would look for food gets deeply entangled with the domain. For example, the modeling of pheromone matrix for the traveler salesman might not be adequate for a Power Systems Unit Commitment problem.For that reason, the initial approach was to create two mainEntities: APower Systemand aPowerColony, where the first must be a Power System which can be solved by a mathematical method and the second should be an Ant Colony initialized to seek optimal results of a Power System problem.Since the dispatch of "multi operative zone" Thermal Generation Units (TGUs) bring non-linearities to the formulation, obtaining a global optimal financial dispach of the system is not a trivial task. The Ant Colony algorithm came in hand as a tool to iteractively seek a global optimal result without having to rely on brute computational force.Defining SystemsThe systems configuration should be defined in thesystems.jsonfile. In the example provided, 3 systems where defined: 's10', 's15' and 's40', the names were chosen for convention and will be used by thePowerSystemclass to initialize the desired configuration.ExampleThe code below samples a possible configuration which can be used to operate the system and solves this configuration.fromacopoweroptimportsystem# Instance a PowerSystem class from a configuration file where 's10` defines a system configurationPSystem=system.PowerSystem(name='s10')# Randomly selects a possible system operation (there are cases where more than a single unit can be operated in diferent configurations)operation=PSystem.sample_operation()# Solve the Economic Dispatch of the units of a specific configuration of the system, in this case, let's use the previously sampled one:solution=PSystem.solve(operation=operation)# Prints total financial cost of the operationprint("Total Financial Cost:{}".format(solution.get('Ft')))# Prints the operation with its power dispach valuesprint(solution.get('operation'))Another option is to bring your own sequence of operative zones (1 for each TGU) and build the operation data from it:fromacopoweroptimportsystem# Intance a PowerSystem class from a configuration file where 's10` defines a system configurationPSystem=system.PowerSystem(name='s10')# Define a sequence of operative zones for each of the 10 TGUsopzs=[2,3,1,2,1,1,3,1,1,3]# Build a configuration that represents such sequence of operative zonesoperation=PSystem.get_operation(operative_zones=opzs)# Solve the Economic Dispatch of the specific configuration:solution=PSystem.solve(operation=operation)# Prints total financial cost of the operationprint("Total Financial Cost:{}".format(solution.get('Ft')))# Prints the operation with its power dispach valuesprint(solution.get('operation'))Defining Power ColoniesAn Ant Colony should seek for a global optimal solution or "the optimal source of food". The algorithm was proposed by Marco Dorigo, checkWikifor more details.ExampleThe code below initializes a PowerColony with a desired PowerSystem as the "environment" for the ants to seek their food. Once instantiated, the PowerColony immediately unleashes their ants for a first seek for solutions, thereforePowerColony.pathsandPowerColony.pheromonecan be observed.fromacopoweroptimportcolony,systemPSystem=system.PowerSystem(name='s15')PColony=colony.PowerColony(n_ants=100,pheromone_evp_rate={'worst':0.75,'mean':0.25,'best':0.05},power_system=PSystem)Now a PowerColony can seek for optimal sources of food:PColony.seek(max_iter=20,power_system=PSystem,show_progress=True)ax=PColony.paths.groupby('iteration').distance.min().plot(y='distance')PColony.create_pheromone_movie(duration=0.25)LicenseSee theLICENSEfile for license rights and limitations (MIT).
acopy
ACOpyAnt Colony Optimizationfor the Traveling Salesman Problem.Free software: Apache Software License 2.0Documentation:https://acopy.readthedocs.io.FeaturesUsesNetworkXfor graph representationSolver can be customized via pluginsHas a utility for plotting information about the solving processCLI tool that supports reading graphs in a variety of formats (includingtsplib95)Support for plotting iteration data using matplotlib and pandasACOpywas formerly called “Pants.”For now, only Python 3.6+ is supported. If there is demand I will add support for 3.4+.CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.7.0 (2020-04-18)Bump all dependencies to latestFix minor display issue in the CLIAdd py37 to the tox config0.6.4 (2019-05-17)Fix the missingacopy.utilspackage problem0.6.3 (2019-05-17)Freshen up the dev dependenciesAdd the Python 3.7 classifierActually fix import issue0.6.2 (2019-02-02)Fix import issue0.6.1 (2018-10-07)Bump dependency on tsplib95 to 0.3.20.6.0 (2018-08-18)First release on PyPI asacopyComplete rewriteSupport fornetworkxSupport fortsplib95Customizable solverPlotting capabilitiesNow uses Apache 2.0 License (formerly GPLv3)Supports only python 3.6+0.5.2 (2014-09-09)Last release on the PyPI asACO-Pants
acor
This is a direct port of a C++ routine byJonathan Goodman(NYU) calledACORthat estimates the autocorrelation time of time series data very quickly.Dan Foreman-Mackey(NYU) made a few surface changes to the interface in order to write a Python wrapper (with the permission of the original author).InstallationJust runpip install acorwithsudoif you really need it.Otherwise, download the source codeas a tarballor clone the git repository fromGitHub:git clone https://github.com/dfm/acor.gitThen runcd acor python setup.py installto compile and install the moduleacorin your Python path. The only dependency isNumPy(including thepython-devandpython-numpy-devpackages which you might have to install separately on some systems).UsageGiven some time seriesx, you can estimate the autocorrelation time (tau) using:import acor tau, mean, sigma = acor.acor(x)Referenceshttp://www.math.nyu.edu/faculty/goodman/software/acor/index.htmlhttp://www.stat.unc.edu/faculty/cji/Sokal.pdf
acora
What is Acora?FeaturesHow do I use it?FAQs and recipesChangelogWhat is Acora?Acora is ‘fgrep’ for Python, a fast multi-keyword text search engine.Based on a set of keywords and theAho-Corasick algorithm, it generates a search automaton and runs it over string input, either unicode or bytes.Acora comes with both a pure Python implementation and a fast binary module written in Cython. However, note that the current construction algorithm is not suitable for really large sets of keywords (i.e. more than a couple of thousand).You can find thelatest source codeon github.To report a bug or request new features, use thegithub bug tracker. Please try to provide a short test case that reproduces the problem without requiring too much experimentation or large amounts of data. The easier it is to reproduce the problem, the easier it is to solve it.Featuresworks with unicode strings and byte stringsabout 2-3x as fast as Python’s regular expression engine for most inputfinds overlapping matches, i.e. all matches of all keywordssupport for case insensitive search (~10x as fast as ‘re’)frees the GIL while searchingadditional (slow but short) pure Python implementationsupport for Python 2.5+ and 3.xsupport for searching in filespermissive BSD licenseHow do I use it?Import the package:>>> from acora import AcoraBuilderCollect some keywords:>>> builder = AcoraBuilder('ab', 'bc', 'de') >>> builder.add('a', 'b')Or:>>> builder.update(['a', 'b']) # new in version 2.0Generate the Acora search engine for the current keyword set:>>> ac = builder.build()Search a string for all occurrences:>>> ac.findall('abc') [('a', 0), ('ab', 0), ('b', 1), ('bc', 1)] >>> ac.findall('abde') [('a', 0), ('ab', 0), ('b', 1), ('de', 2)]Iterate over the search results as they come in:>>> for kw, pos in ac.finditer('abde'): ... print("%2s[%d]" % (kw, pos)) a[0] ab[0] b[1] de[2]Acora also has direct support for parsing files (in binary mode):>>> keywords = ['Import', 'FAQ', 'Acora', 'NotHere'.upper()] >>> builder = AcoraBuilder([s.encode('ascii') for s in keywords]) >>> ac = builder.build() >>> found = set(kw for kw, pos in ac.filefind('README.rst')) >>> len(found) 3 >>> sorted(str(s.decode('ascii')) for s in found) ['Acora', 'FAQ', 'Import']FAQs and recipesHow do I run a greedy search for the longest matching keywords?>>> builder = AcoraBuilder('a', 'ab', 'abc') >>> ac = builder.build() >>> for kw, pos in ac.finditer('abbabc'): ... print(kw) a ab a ab abc >>> from itertools import groupby >>> from operator import itemgetter >>> def longest_match(matches): ... for pos, match_set in groupby(matches, itemgetter(1)): ... yield max(match_set) >>> for kw, pos in longest_match(ac.finditer('abbabc')): ... print(kw) ab abcNote that this recipe assumes search terms that do not have inner overlaps apart from their prefix.How do I parse line-by-line with arbitrary line endings?>>> def group_by_lines(s, *keywords): ... builder = AcoraBuilder('\r', '\n', *keywords) ... ac = builder.build() ... ... current_line_matches = [] ... last_ending = None ... ... for kw, pos in ac.finditer(s): ... if kw in '\r\n': ... if last_ending == '\r' and kw == '\n': ... continue # combined CRLF ... yield tuple(current_line_matches) ... del current_line_matches[:] ... last_ending = kw ... else: ... last_ending = None ... current_line_matches.append(kw) ... yield tuple(current_line_matches) >>> kwds = ['ab', 'bc', 'de'] >>> for matches in group_by_lines('a\r\r\nbc\r\ndede\n\nab', *kwds): ... print(matches) () () ('bc',) ('de', 'de') () ('ab',)How do I find whole lines that contain keywords, as fgrep does?>>> def match_lines(s, *keywords): ... builder = AcoraBuilder('\r', '\n', *keywords) ... ac = builder.build() ... ... line_start = 0 ... matches = False ... for kw, pos in ac.finditer(s): ... if kw in '\r\n': ... if matches: ... yield s[line_start:pos] ... matches = False ... line_start = pos + 1 ... else: ... matches = True ... if matches: ... yield s[line_start:] >>> kwds = ['x', 'de', '\nstart'] >>> text = 'a line with\r\r\nsome text\r\ndede\n\nab\n start 1\nstart\n' >>> for line in match_lines(text, *kwds): ... print(line) some text dede startChangelog2.4 [2023-09-17]Update to work with CPython 3.12 by building with Cython 3.0.2.2.3 [2021-03-27]Update to work with CPython 3.9 by building with Cython 0.29.22.2.2 [2018-08-16]Update to work with CPython 3.7 by building with Cython 0.29.2.1 [2017-12-15]fix handling of empty engines (Github issue #18)2.0 [2016-03-17]rewrite of the construction algorithm to speed it up and save memory1.9 [2015-10-10]recompiled with Cython 0.23.4 for better compatibility with recent Python versions.1.8 [2014-02-12]pickle support for the pre-built search enginesperformance optimisations in builderUnicode parsing is optimised for Python 3.3 and laterno longer recompiles sources when Cython is installed, unless--with-cythonoption is passed to setup.py (requires Cython 0.20+)build failed with recent Cython versionsbuilt using Cython 0.20.11.7 [2011-08-24]searching binary strings for byte values > 127 was brokenbuilt using Cython 0.15+1.6 [2011-07-24]substantially faster automaton buildingno longer includes .hg repo in source distributionbuilt using Cython 0.15 (rc0)1.5 [2011-01-24]Cython compiled NFA-2-DFA construction runs substantially fasteralways build extension modules even if Cython is not installed--no-compileswitch insetup.pyto prevent extension module buildingbuilt using Cython 0.14.1 (rc2)1.4 [2009-02-10]minor speed-up in inner search engine loopsome code cleanupbuilt using Cython 0.12.1 (final)1.3 [2009-01-30]major fix for file searchbuilt using Cython 0.12.1 (beta0)1.2 [2009-01-30]deep-copy support for AcoraBuilder classdoc/test fixesinclude .hg repo in source distributionbuilt using Cython 0.12.1 (beta0)1.1 [2009-01-29]doc updatessome cleanupbuilt using Cython 0.12.1 (beta0)1.0 [2009-01-29]initial release
acore-conf
Welcome toacore_confDocumentation背景AzerothCore(acore) 是一个开源的魔兽世界模拟器, 其代码质量以及文档是目前 (2023 年) 我看来所有的开源魔兽世界模拟器中最好的. 它有一个.conf配置文件格式用于定义服务器的各种配置. 这个格式不是 acore 独有的, 而是所有的魔兽世界模拟器, 包括各个不同的资料片几乎都用的这个格式.How configuration files are composedauthserver.confworldserver.conf关于本项目本项目是一个简单的 Python 工具, 用于管理, 修改.conf文件. 使得开发者可以用业内比较通用的 JSON 格式对.conf进行修改.用法fromacore_conf.apiimportapply_changesapply_changes("/path/to/authserver.conf.dist","/path/to/authserver.conf",data={"worldserver":{"DataDir":"/home/azeroth-server/data"}},)Installacore_confis released on PyPI, so all you need is to:$pipinstallacore-confTo upgrade to latest version:$pipinstall--upgradeacore-conf
acore-constants
Welcome toacore_constantsDocumentation由于 acore 项目过于复杂, 它由有非常多个开源子项目. 虽然这些项目之间已经尽量解耦了并且尽量保持互相独立, 不过他们之间总是需要引用一些常量. 所以我们单独开了一个项目来管理这些常量, 以供在其他项目中引用. 避免了这些子项目之间互相引用的麻烦.所有常量的列表以及详细描述请参考constants.py.Installacore_constantsis released on PyPI, so all you need is to:$pipinstallacore-constantsTo upgrade to latest version:$pipinstall--upgradeacore-constants
acore-db-ssh-tunnel
Welcome toacore_db_ssh_tunnelDocumentation出于安全考虑, 通常数据库都会被部署到私网中, 是不允许直接从公网访问的. 为了能让开发者从工具配置齐全的开发电脑连接到数据库, 通常采用跳板机 +SSH Tunnel技术实现. 具体方法是用 SSH 和 EC2 的秘钥在本地机器上建立一个 tunnel, 所有本来要发送到 Database domain 的流量都发送到 127.0.0.1, 然后 SSH 会自动将流量发送到跳板机, 然后堡垒机再发送到 Database.本项目将创建, 关闭, 查看, 以及测试 SSH Tunnel 的方法封装成了一个 Python package, 以便于在 Python 代码中使用.用例fromacore_db_ssh_tunnelimportapidefcreate_ssh_tunnel():api.create_ssh_tunnel(path_pem_file=path_pem_file,db_host=db_host,db_port=db_port,jump_host_username=jump_host_username,jump_host_public_ip=jump_host_public_ip,)deflist_ssh_tunnel():api.list_ssh_tunnel(path_pem_file)deftest_ssh_tunnel():api.test_ssh_tunnel(db_port=db_port,db_username=db_username,db_password=db_password,db_name=db_name,)defkill_ssh_tunnel():api.kill_ssh_tunnel(path_pem_file)# edit the following variables to your owndb_host="my-server.1a2b3c4d5e6f.us-east-1.rds.amazonaws.com"db_port=3306db_username="admin"db_password="admin"db_name="my_database"jump_host_username="ubuntu"jump_host_public_ip="111.111.111.111"path_pem_file="/Users/myusername/ec2-key.pem"# create_ssh_tunnel() # run this first# list_ssh_tunnel() # then this# test_ssh_tunnel() # then this# kill_ssh_tunnel() # then clean upInstallacore_db_ssh_tunnelis released on PyPI, so all you need is to:$pipinstallacore-db-ssh-tunnelTo upgrade to latest version:$pipinstall--upgradeacore-db-ssh-tunnel
acore-paths
Welcome toacore_pathsDocumentationAzerothcore 魔兽世界服务器上的文件目录结构定义. 你可以直接用import acore_paths.api as acore_paths来 import 这些路径, 并在业务代码中引用这些路径. 每一个路径都是一个pathlib.Path对象, 并且都是绝对路径. 该项目可以作为一个 Python 库供其他项目使用, 从而避免了重复定义目录结构的麻烦, 避免了手写路径时可能出现的错误, 一次发明, 到处使用.注:本项目支持 Python3.4+, 没有任何依赖.点击这里查看所有重要路径的定义.Usages>>>importacore_paths.apiasacore_paths>>>acore_paths.dir_...>>>acore_paths.path_...Installacore_pathsis released on PyPI, so all you need is to:$pipinstallacore-pathsTo upgrade to latest version:$pipinstall--upgradeacore-paths
acore-server
Welcome toacore_serverDocumentation项目背景一个魔兽世界服务器由一个 EC2 游戏服务器 和一个 RDS DB Instance 数据库组成. 其中游戏服务器和数据库的配置信息, 例如账号密码, 机器的 CPU 内存大小, 都由acore_server_metadata这个库管理. 而对于 EC2 和 RDS 的 metadata, 例如 IP 地址, host, 在线状态, 以及对其进行创建, 启动, 停止, 删除等操作则是由acore_server_config这个库管理. 要想远程运行 GM 命令, 则需要用到acore_soap_app这个库. 要想在本地进行数据库应用开发, 则需要用到acore_db_ssh_tunnel这个库.本项目则是将以上四个库整合到一起, 用acore_server.api.Server作为一个统一的入口, 以便于在一个项目中同时使用以上四个库. 并且在对这些子库的 API 调用进行了封装, 将跟 Server 相关的参数都封装起来, 使得我们可以用最少的参数, 方便地调用这些子库的 API.Installacore_serveris released on PyPI, so all you need is to:$pipinstallacore-serverTo upgrade to latest version:$pipinstall--upgradeacore-server
acore-server-config
Welcome toacore_server_configDocumentation📔完整文档点这里项目背景在生产环境中一个 “魔兽世界服务器” 通常有多个 “大区”, 亚洲, 北美, 美国西部, 美国东部等. 每个 “大区” 下有多组服务器, 一个服务器也就是我们在选择服务器见面看到的 Realm, 比如国服著名的 “山丘之王”, “洛萨” 等. 每个服务器都有自己的配置, 例如数据库账号密码等. 那么如何对这么多服务器的配置进行管理呢? 本项目就是为了解决这个问题而生的.下面我们来看看具体需求.从开发者的角度看, 我们需要对服务器集群配置进行批量管理和部署. 而我们希望将服务器本身和配置数据分离, 以便于在不重新部署服务器的情况下更新配置. 根据上一段提到的服务器层级架构, 我们需要一个树状的数据结构来定义这些服务器的配置. 例如一个大区有它默认设置. 在这个大区下的所有服务器如果没有特别说明, 则沿用大区默认设置. 如果有特别说明则用特别说明的设置. 所以我们这个项目需要解决批量管理的功能. 幸运的是, 我以前为企业做的一个项目中有一个按树状结构, 批量管理多个环境的配置的模块config_patterns刚好可以解决这一问题.而从服务器的角度看, 出于安全考虑, 每个服务器只要知道自己的配置即可, 不需要知道其他服务器的配置. 所以我们需要一个脚本用于“自省”(自己判断自己是谁, 去哪里读取配置数据) 并读取属于自己这个服务器的配置数据. 这个脚本只需要能在服务器上运行即可.为了解决以上两个需求, 我创建了这一项目. 请阅读完整文档做进一步了解.
acore-server-metadata
Welcome toacore_server_metadataDocumentation背景AzerothCore(acore) 是一个开源的魔兽世界模拟器, 其代码质量以及文档是目前 (2023 年) 我看来所有的开源魔兽世界模拟器中最好的. 根据魔兽世界官服服务器的架构, 每一个 realm (大区下的某个服务器, 例如国服著名的山丘之王, 洛萨等) 一般都对应着一个单体虚拟机和一个单体数据库. 一个大区下有很多这种服务器, 而在生产环境和测试开发环境下又分别有很多这种服务器. 所以我需要开发一个工具对于这些服务器进行管理, 健康检查等.我假设游戏服务器虚拟机和数据库都是在 AWS 上用 EC2 和 RDS 部署的. 所以这个项目只能用于 AWS 环境下的服务器管理.关于本项目本项目是一个简单的 Python 包, 提供了对一个 realm 服务器的抽象.基础用例, 获取服务器状态# 获取服务器的状态>>>importboto3>>>fromacore_server_metadata.apiimportServer>>>server_id="prod">>>server=Server.get_server(server_id,ec2_client,rds_client)>>>serverServer(id='prod-1',ec2_inst=Ec2Instance(id='i-1a2b3c4d',status='running',...tags={'wserver:server_id':'prod'},data=...),rds_inst=RDSDBInstance(id='db-inst-1',status='available',tags={'wserver:server_id':'prod'},data=...),)# 检查服务器的状态>>>server.is_exists()>>>server.is_running()>>>server.is_ec2_exists()>>>server.is_ec2_running()>>>server.is_rds_exists()>>>server.is_rds_running()# 重新获取服务器的状态>>>server.refresh()# 批量获取服务器的状态, 进行了一些优化, 以减少 API 调用次数>>>server_mapper=Server.batch_get_server(...ids=["prod-1","prod-2","dev-1","dev-2"],...ec2_client=ec2_client,...rds_client=rds_client,...)>>>server_mapper{"prod-1":<Serverid="prod-1">,"prod-2":<Serverid="prod-2">,"dev-1":<Serverid="dev-1">,"dev-2":<Serverid="dev-2">,}对服务器进行操作# 创建新的 EC2>>>server.run_ec2(ec2_client,ami_id,instance_type,...)# 创建新的 DB Instance>>>server.run_rds(rds_client,db_snapshot_identifier,db_instance_class,...)# 启动 EC2>>>server.start_ec2(ec2_client)# 启动 RDS>>>server.start_rds(rds_client)# 停止 EC2>>>server.stop_ec2(ec2_client)# 停止 RDS>>>server.stop_rds(rds_client)# 删除 EC2>>>server.delete_ec2(ec2_client)# 删除 RDS>>>server.delete_rds(rds_client)# 更新 DB 的 master password>>>server.update_db_master_password(rds_client,master_password)# 关联 EIP 地址>>>server.associate_eip_address(...)# 创建数据库备份>>>server.create_db_snapshot(...)# 清理数据库备份>>>server.cleanup_db_snapshot(...)Installacore_server_metadatais released on PyPI, so all you need is to:$pipinstallacore-server-metadataTo upgrade to latest version:$pipinstall--upgradeacore-server-metadata
acore-soap-app
Welcome toacore_soap_appDocumentation📔完整文档点这里魔兽世界服务器 worldserver 自带一个交互式的 Console. GM 可以在里面输入命令来创建账号, 修改密码, 封禁账号等. 你如果用 GM 账号登录游戏, 你也可以在游戏内聊天框输入 GM 命令, 本质是一样的. 但是你需要 SSH 到服务器上才能访问这个 Console 界面, 又或是要登录游戏才能输入 GM 命令, 且这些命令必须要人类手动输入. 简而言之, 这套系统是给人类用的. 但是作为服务器维护者, 你会有需要用程序扫描数据库, 日志分析用户行为, 并且进行自动化维护, 例如封号, 发邮件等等. 这些自动化运维的脚本可能是在游戏服务器上运行, 也可能是在其他地方运行, 例如其他 EC2, 容器, Lambda. 这时我们就需要一套机制能安全地 (仅让有权限的人或机器) 远程执行 GM 命令. 这个需求对于长期的正式运营非常重要. 例如你需要玩家能登录你的服务器官网注册账号, 交易物品等等. 那么你就需要你的官网 Web 服务器能远程执行一些 GM 命令.该项目是一个针对这个需求的完整解决方案, 它包含两个组件 Agent 和 SDK.Agent: 提供了一个部署在游戏服务器 EC2 上的命令行程序, 作为外部 API 调用的桥梁. 使得外部有权限的开发者可以通过 AWS SSM Run Command 远程调用这个命令行程序, 从而实现远程执行 GM 命令.SDK: 提供了一套远程运行服务器命令的 SDK, 并提供了很多高级功能例如批量执行, 错误处理等功能. 使得开发者可以很方便的编写出基于 GM 命令的应用程序.在 EC2 上安装完 Agent 之后, 你可以用下面的命令测试./home/ubuntu/git_repos/acore_soap_app-project/.venv/bin/acsoapgm".server info"Installacore_soap_appis released on PyPI, so all you need is to:$pipinstallacore-soap-appTo upgrade to latest version:$pipinstall--upgradeacore-soap-app
acorn
Automatic Computational Research Notebookacornuses the mutability of python objects, together with decorators, to produce an automatic notebook for computational research. Common libraries likenumpy,scipy,sklearnandpandasare mutated with decorators that enable logging of calls to important methods within those libraries.This is really helpful for data science where experimenting with fits, pipelines and pre-processing transformations can result in hundreds of fits and predictions a day. At the end of the day, it is hard to remember which set of parameters produced that one fit, which (of course) you didn’t realize was important at the time.The library iswell documented.Basic FlowDepending on the logging level, every time a method/function is called (whether bound or unbound), we log it into a JSON database.The JSON database is analyzed using javascript by the browser to produce nice sets of objects, separated by project, task, date and specific object instances.A nice UI usingbootstrappopulates the HTML dynamically.SynchronizationWe recommend that the JSON database directory be configured on a Dropbox folder (later we will support Google Drive, etc.). The HTML notebook can be authorized (per session) to have access to Dropbox so that the JSON databases can be accessed from anywhere (and any device). Thi HTML and javascript is completely standalone (i.e., no server backend required outside of the web service requests).ContributionIf this sparks your interest, please message us. The project is still in early development, so we can’t say more up front.Special NotesThematplotlibmodule is used frequently, but not in the typical way. Most of the methods and objects are used internally unless a plot is being tweaked for some special reason. Thematplotlib.cfgfile prunes the number of objects that get decorate very aggressively so that only the common calls are logged. You can adjust your own local config file if you spend a lot of time actually codingmatplotlibinternals.
acornio
An Asynchronous WSGI server.Work in progress... please call back soon!pipinstallacorn-ioAuthorsJoe Gasewicz-Initial work-JoeGasewiczLicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for detailsAcknowledgments...
acornwalk
Acorn AST walkerAn abstract syntax tree walker for theESTreeformat.Python translation of acorn-walk from theacornjs/acornrepository.
aco-routing
Ant Colony OptimizationA Python package to find the shortest path in a graph using Ant Colony Optimization (ACO).The Ant colony Optimization algorithm is a probabilistic technique for solving computational problems which can be reduced to finding good paths through graphs (source).This implementation of the ACO algorithm uses theNetworkXgraph environment.🏁 Getting StartedTo install the package directly from PyPi:$ pip install aco_routing🎈 UsageCheck out:example.pyImport all the dependencies:fromaco_routingimportACOimportnetworkxasnxCreate aNetworkX.Graphobject with nodes and edges:G=nx.DiGraph()G.add_edge("A","B",cost=2)G.add_edge("B","C",cost=2)G.add_edge("A","H",cost=2)G.add_edge("H","G",cost=2)G.add_edge("C","F",cost=1)G.add_edge("F","G",cost=1)G.add_edge("G","F",cost=1)G.add_edge("F","C",cost=1)G.add_edge("C","D",cost=10)G.add_edge("E","D",cost=2)G.add_edge("G","E",cost=2)Use ACO to find the shortest path and cost between thesourceanddestination:aco=ACO(G,ant_max_steps=100,num_iterations=100,ant_random_spawn=True)aco_path,aco_cost=aco.find_shortest_path(source="A",destination="D",num_ants=100,)Output:ACO path: A -> H -> G -> E -> D ACO path cost: 8.0📦 ContentsAntaco_routing.AntAnAntthat traverses the graph.ACOaco_routing.ACOThe traditional Ant Colony Optimization algorithm that spawns ants at various nodes in the graph and finds the shortest path between the specified source and destination (pseudo code).ContributingPost any issues and suggestions on the GitHubissuespage.To contribute, fork the project and then create a pull request back to master.LicenseThis project is licensed under the MIT License - see theLICENSEfile for details.
acos-client
ACOS ClientTable of ContentsSupported VersionsInstallation for ACOSv4.1.4Installation for ACOSv4.1.1Example usage informationContributing & TestingIssues and InquiriesHelpful LinksSupported Versions| ACOS Version | AXAPI Version | ACOS Client Version | Status | | 2.7.1† | 2 | >=0.1.0,<0.3.0 | end-of-life | | 2.7.2 | 2 | >=0.1.0,<0.3.0 | end-of-life | | 4.0.0 | 3 | >=1.4.6,<1.5.0 | end-of-life | | 4.1.1 | 3 | >=1.5.0,<2.0.0 | end-of-life | | 4.1.4 GR1-P2 | 3 | >=2.0.0,<2.4.0 | end-of-life | | 4.1.4 | 3 | >=2.4.0 | end-of-life | | 4.1.4 GR1-P5 | 3 | >=2.6.0 | Maintenance | | 5.2.1 | 3 | >=2.6.0 | Maintenance | | 5.2.1-p1 | 3 | >=2.7.0 | Maintenance | | 5.2.1-p2 | 3 | >=2.9.0 | Maintenance | | 5.2.1-p2 | 3 | >=2.9.1 | Maintenance | | 5.2.1-p2 | 3 | >=2.10.0 | Maintenance |†Works only when not using partitioningInstallationInstall using pip$pipinstallacos-client>=2.9.0Install from source$gitclonehttps://github.com/a10networks/acos-client.git $cdacos-client $gitcheckoutstable/stein $pipinstall-e.Usagec=acos_client.Client('somehost.example.com',acos_client.AXAPI_30,'admin','password')Example setting up an SLB:importacos_clientasacosc=acos.Client('1.2.3.4',acos.AXAPI_30,'admin','password')c.slb.server.create('s1','1.1.1.1')c.slb.server.create('s2','1.1.1.2')c.slb.service_group.create('pool1',c.slb.service_group.TCP,c.slb.service_group.ROUND_ROBIN)c.slb.virtual_server.create('vip1','1.1.1.3')c.slb.hm.create('hm1',c.slb.hm.HTTP,5,5,5,'GET','/','200',80)c.slb.service_group.update('pool1',health_monitor='hm1')c.slb.service_group.member.create('pool1','s1',80)c.slb.service_group.member.create('pool1','s2',80)ContributingFork itCreate your feature branch (git checkout -b my-new-feature)Commit your changes (git commit -am 'Add some feature')Push to the branch (git push origin my-new-feature)Create new Pull RequestTestingThis project usestoxfor testing. To run the test suite simply:$sudopipinstalltox# use pip2 if using Arch Linux$cd/path/to/acos_client $toxIssues and InquiriesFor all issues, please send an email [email protected] linksImproved speedpypy:http://pypy.org/index.htmlOld python versionsDeadsnakes github:https://github.com/deadsnakesDeadsnakes ppa:https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
acoss
acoss: Audio Cover Song Suiteacoss: Audio Cover Song Suiteis a feature extraction and benchmarking frameworks for the cover song identification (CSI) tasks. This tool has been developed along with the newDA-TACOSdataset.acossincludes a standard feature extraction framework with state-of-art audio features for CSI task and open source implementations of seven state-of-the-art CSI algorithms to facilitate the future work in this line of research. Using this framework, researchers can easily compare existing algorithms on different datasets, and we encourage all CSI researchers to incorporate their algorithms into this framework which can easily done following the usage examples.Please site our paper if you use this tool in your resarch.Furkan Yesiler, Chris Tralie, Albin Correya, Diego F. Silva, Philip Tovstogan, Emilia Gómez, and Xavier Serra. Da-TACOS: A Dataset for Cover Song Identification and Understanding. In 20th International Society for Music Information Retrieval Conference (ISMIR 2019), Delft, The Netherlands, 2019.Benchmarking results onDa-Tacosdataset can be found in the paper.Setup & InstallationWe recommend you to install the package inside a pythonvirtualenv.Install using pippipinstallacossORInstall from source (recommended)Clone or download the repo.Installacosspackage by using the following command inside the directory.python3setup.pyinstallAdditional dependenciesacossrequires a local installation of madmom library for computing some audio features and essentia library for similarity algorithms.For linux-based distro users,pip install "acoss[extra-deps]"or if you are a Mac OSX user,you can install madmom from pippip install madmomyou can installessentiafrom homebrewbrew tap MTG/essentia brew install essentia --HEADDocumentation and examplesacossmainly provides the following python sub-modules-acoss.algorithms: Sub-module with various cover identification algorithms, utilities for similarity comparison and an template for adding new algorithms.acoss.coverid: Interface to benchmark a specific cover identification algorithms.acoss.features: Sub-module with implementation of various audio features.acoss.extractors: Interface to do efficient batch audio feature extraction for an audio dataset.acoss.utils: Utility functions used in acoss package.acoss.coverid.benchmarkCover Song Identification algorithms inacossSerra09PaperLateFusionChenPaperEarlyFusionTrailePaperSiMPlePaperFTM2DPaperMOVEadding soon ...acoss.extractors.batch_feature_extractor{ "chroma_cens": numpy.ndarray, "crema": numpy.ndarray, "hpcp": numpy.ndarray, "key_extractor": { "key": numpy.str_, "scale": numpy.str_,_ "strength": numpy.float64 }, "madmom_features": { "novfn": numpy.ndarray, "onsets": numpy.ndarray, "snovfn": numpy.ndarray, "tempos": numpy.ndarray } "mfcc_htk": numpy.ndarray, "label": numpy.str_, "track_id": numpy.str_ }Dataset structure required for acossAudio dataaudio_dir /work_id /track_id.mp3Feature filefeature_dir /work_id /track_id.h5importdeepdishasddfeature=dd.load("feature_file.h5")An example feature file will be in the following structure.{ 'feature_1': [], 'feature_2': [], 'feature_3': {'type_1': [], 'type_2': [], ...}, ...... }CSV annotation file for a datasetwork_idtrack_idW_163930P_546633......acossbenchmark methods expect the dataset annotation csv file in the above given format.There are also some utility functions inacosswhich generates the csv annotation file automatically for da-tacos from it's subset metadata file and for covers80 dataset from it's audio data directory.fromacoss.utilsimportda_tacos_metadata_to_acoss_csvda_tacos_metadata_to_acoss_csv("da-tacos_benchmark_subset_metadata.json","da-tacos_benchmark_subset.csv")fromacoss.utilsimportgenerate_covers80_acoss_csvgenerate_covers80_acoss_csv("coversongs/covers32k/","covers80_annotations.csv")For quick prototyping, let's use the tinycovers80, dataset.Audio feature extractionfromacoss.utilsimportCOVERS_80_CSVfromacoss.extractorsimportbatch_feature_extractorfromacoss.extractorsimportPROFILEprint(PROFILE){ 'sample_rate': 44100, 'input_audio_format': '.mp3', 'downsample_audio': False, 'downsample_factor': 2, 'endtime': None, 'features': ['hpcp', 'key_extractor', 'madmom_features', 'mfcc_htk'] }Compute# Let's define a custom acoss extractor profileextractor_profile={'sample_rate':32000,'input_audio_format':'.mp3','downsample_audio':True,'downsample_factor':2,'endtime':None,'features':['hpcp']}# path to audio dataaudio_dir="../coversongs/covers32k/"# path where you wanna store your datafeature_dir="features/"# Run the batch feature extractor with 4 parallel workersbatch_feature_extractor(dataset_csv=COVERS_80_CSV,audio_dir=audio_dir,feature_dir=feature_dir,n_workers=4,mode="parallel",params=extractor_profile)Benchmarkingfromacoss.coveridimportbenchmark,algorithm_namesfromacoss.utilsimportCOVERS_80_CSV# path to where your audio feature h5 files are locatedfeature_dir="features/"# list all the available algorithms in acossprint(algorithm_names)# we can easily benchmark any of the given cover id algorithm# on the given dataset using the following functionbenchmark(dataset_csv=COVERS_80_CSV,feature_dir=feature_dir,algorithm="Serra09",parallel=False)# result of the evaluation will be stored in a csv file# in the current working directory.How to add my algorithm inacoss?Defining my algorithmfromacoss.algorithms.algorithm_templateimportCoverSimilarityclassMyCoverIDAlgorithm(CoverSimilarity):def__init__(self,dataset_csv,datapath,name="MyAlgorithm",shortname="mca"):CoverAlgorithm.__init__(self,dataset_csv=dataset_csv,name=name,datapath=datapath,shortname=shortname)defload_features(self,i):"""Define how to want to load the features"""feats=CoverAlgorithm.load_features(self,i)# add your modification to feature arraysreturndefsimilarity(self,idxs):"""Define how you want to compute the cover song similarity"""returnRunning benchmark on my algorithm# create an instance your algorithmmy_awesome_algorithm=MyCoverIDAlgorithm(dataset_csv,datapath)# run pairwise comparisonmy_awesome_algorithm.all_pairwise()# Compute standard evaluation metricsforsimilarity_typeinmy_awesome_algorithm.Ds.keys():print(similarity_type)my_awesome_algorithm.getEvalStatistics(similarity_type)my_awesome_algorithm.cleanup_memmap()How to contribute?Fork the repo!Create your feature branch: git checkout -b my-new-featureAdd your new audio feature or cover identification algorithm to acoss.Commit your changes: git commit -am 'Add some feature'Push to the branch: git push origin my-new-featureSubmit a pull requestAcknowledgmentsThis project has received funding from the European Union's Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No. 765068 (MIP-Frontiers).This work has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 770376 (Trompa).
acoular
AcoularAcoular is a Python module for acoustic beamforming that is distributed under the new BSD license.It is aimed at applications in acoustic testing. Multichannel data recorded by a microphone array can be processed and analyzed in order to generate mappings of sound source distributions. The maps (acoustic photographs) can then be used to locate sources of interest and to characterize them using their spectra.Featuresfrequency domain beamforming algorithms: delay & sum, Capon (adaptive), MUSIC, functional beamforming, eigenvalue beamformingfrequency domain deconvolution algorithms: DAMAS, DAMAS+, Clean, CleanSC, orthogonal deconvolutionfrequency domain inverse methods: CMF (covariance matrix fitting), general inverse beamforming, SODIXtime domain methods: delay & sum beamforming, CleanT deconvolutiontime domain methods applicable for moving source with arbitrary trajectory (linear, circular, arbitrarily 3D curved),frequency domain methods for rotating sources via virtual array rotation for arbitrary arrays and with different interpolation techniques1D, 2D and 3D mapping grids for all methodsgridless option for orthogonal deconvolutionfour different built-in steering vector formulationsarbitrary stationary background flow can be considered for all methodsefficient cross spectral matrix computationflexible modular time domain processing: n-th octave band filters, fast, slow, and impulse weighting, A-, C-, and Z-weighting, filter bank, zero delay filterstime domain simulation of array microphone signals from fixed and arbitrarily moving sources in arbitrary flowfully object-oriented interfacelazy evaluation: while processing blocks are set up at any time, (expensive) computations are only performed when neededintelligent and transparent caching: computed results are automatically saved and loaded on the next run to avoid unnecessary re-computationparallel (multithreaded) implementation with Numba for most algorithmseasily extendable with new algorithmsLicenseAcoular is licensed under the BSD 3-clause. SeeLICENSECitingIf you use Acoular for academic work, please consider citing ourpublication:Ennes Sarradj, Gert Herold, A Python framework for microphone array data processing, Applied Acoustics, Volume 116, 2017, Pages 50-58DependenciesAcoular runs under Linux, Windows and MacOS and needs Numpy, Scipy, Traits, scikit-learn, pytables, Numba packages available. Matplotlib is needed for some of the examples.If you want to use input from a soundcard hardware, you will also need to install thesounddevicepackage. Some solvers for the CMF method needPylops.InstallationAcoular can be installed viaconda, which is also part of theAnaconda Python distribution. It is recommended to install into a dedicatedconda environment. After activating this environment, runconda install -c acoular acoularThis will install Acoular in your Anaconda Python enviroment and make the Acoular library available from Python. In addition, this will install all dependencies (those other packages mentioned above) if they are not already present on your system.A second option is to install Acoular viapip. It is recommended to use a dedicatedvirtual environmentand then runpip install acoularFor more detailed install instructions see thedocumentation.Documentation and helpDocumentation is availableherewith agetting startedsection andexamples.The Acoularblogcontains some tutorials.Problems, suggestions and success using Acoular may be reported via theacoular-usersdiscussion forum.ExampleThis reads data from 64 microphone channels and computes a beamforming map for the 8kHz third octave band:fromosimportpathimportacoularfrommatplotlib.pylabimportfigure,plot,axis,imshow,colorbar,show# this file contains the microphone coordinatesmicgeofile=path.join(path.split(acoular.__file__)[0],'xml','array_64.xml')# set up object managing the microphone coordinatesmg=acoular.MicGeom(from_file=micgeofile)# set up object managing the microphone array data (usually from measurement)ts=acoular.TimeSamples(name='three_sources.h5')# set up object managing the cross spectral matrix computationps=acoular.PowerSpectra(time_data=ts,block_size=128,window='Hanning')# set up object managing the mapping gridrg=acoular.RectGrid(x_min=-0.2,x_max=0.2,y_min=-0.2,y_max=0.2,z=0.3,\increment=0.01)# set up steering vector, implicitely contains also the standard quiescent# environment with standard speed of soundst=acoular.SteeringVector(grid=rg,mics=mg)# set up the object managing the delay & sum beamformerbb=acoular.BeamformerBase(freq_data=ps,steer=st)# request the result in the 8kHz third octave band from approriate FFT-Lines# this starts the actual computation (data intake, FFT, Welch CSM, beamforming)pm=bb.synthetic(8000,3)# compute the sound pressure levelLm=acoular.L_p(pm)# plot the mapimshow(Lm.T,origin='lower',vmin=Lm.max()-10,extent=rg.extend(),\interpolation='bicubic')colorbar()
acous
AcousAcoustics computing package for Python.
acousondePy
acousondePyTranslate Acousonde MT filesThis software lets you load any Acousonde produced MT files and convert them into easier to use formats.Acoustic data files are converted into wav filesHeader information is stored as csv fileAuxiliary data if present is concatenated into one csv fileFor more information on Acousonde visit theAcousonde websiteCurrently there are 4 functions available:MTread() to read one MT filespec_plot(p,HEADER,INFO) to create a spectrogram plotread_multiple_MT() to read a list of MT filesacousonde() starts a GUI which allows you to convert slected MT filesAcousonde is available onPypiA single Windows executable file of acousonde() which can be used without the need of any programming/scripting and does not require the user to have Python isnstalled can be obtained fromSourceforge.Installationpip install acousondePyIf you have a previous version of acousondePy installed upgrade the package:pip install acousondePy -ULicenceThis software is free to use.MIT License Copyright (c) 2020 Sven Gastauer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.ExamplesFor a full example have a look at the Notebooks in the notebook folder.importacousondePyasapimportglob#get example file dirpdir=ap.__path__[0]#get list of example filesfns=glob.glob(pdir+'\\\data\*.MT')#read an acoustic MT filep,HEADER,INFO=ap.MTread(fns[4])#create a spectrogram plot_=ap.spec_plot(p,HEADER,INFO)#read multiple MT filesap.read_multiple_MT(fns)
acoustic
Failed to fetch description. HTTP Status Code: 404
acoustic-analyser
Acoustic AnalyserAn Open Source package to perform nodal analysis on simple 2D structures using wave based approachAuthorsDhruv BhatiaDr. Abhijit SarkarInstallationPre-requisites:numpysympyscipymatplotlibYou can install tha package through both pip and using the releases present on github.Installing through pip:pipinstallacoustic_analyserInstalling through github:You can find the latest release zip filehereDownload the zip file to a folder and extract its contentsThen run the following command in the terminal from the folder you extracted:pipinstall.Usage:You can find the example problems to get startedhere.
acoustic-odometry
Acoustic OdometryA standalone C++ library with dependencies managed byvcpkgaccessible through Python usingpybind11.Example usageCreate a clean Python virtual environmentpython -m venv venvActivate it on Windows.\venv\Scripts\activateotherwisesource ./venv/bin/activateInstall this projectpip install git+https://github.com/AcousticOdometry/AO.gitorpip install git+ssh://[email protected]/AcousticOdometry/AO.gitIt will take a while to build as it will build the C++ dependencies as well, but it will work. It is definitely not the most optimal way of installing a package as we are installing as well thevcpkgpackage manager and building from source dependencies that might as well be installed on the system. But this allows a fast development environment where adding or removing C++ dependencies should be easy.Test that the C++ code is working in the Python packageTODOSetupInstall the requirementsInstallvcpkgrequirements with the addition ofcmakeand Python. It could be summarized as:gitBuild tools (Visual Studioon Windows orgccon Linux for example)cmakePython. Make sure to have development tools installed (python3.X-devon Linux, beingXyour version of Python).If running on a clean linux environment (like a container or Windows Subsystem for Linux) you will need to install some additional tools as it is stated invcpkg.sudo apt-get install build-essential curl zip unzip tar pkg-config libssl-dev python3-devThis library is additionally based on modern C++17 with some C++20 features. Therefore it requires a C++ compiler that supports C++20. In linux,gccversion 11 is recommended. Fortunately,several versions ofgcccan co-live together.sudo apt install software-properties-common sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt install gcc-11 g++-11 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 \ --slave /usr/bin/g++ g++ /usr/bin/g++-11Git Large File SystemNeeded for the model fileshttps://git-lfs.github.com/CMakeFollow theofficial instructions.The requiredcmakeversion is quite high, if you are using a Linux distribution and installingcmakefrom the repositories take into account that they might not be updated to the latest version. However there are options toinstall the latest version ofcmakefrom the command line.Make sure that when you runcmake --versionthe output is3.21or higher. The reason for this is that we are using some of the3.21features to install runtime dependencies (managed withvcpkg) together with our project so they are available to Python when using its API.Clone this repository withvcpkgCone this repository withvcpkgas a submodule and navigate into it.git clone --recursive [email protected]:esdandreu/python-extension-cpp.git cd python-extension-cppBootstrapvcpkgin Windows. Make sure you haveinstalled the prerequisites..\vcpkg\bootstrap-vcpkg.batOr in Linux/MacOS. Make sure you haveinstalled developer tools./vcpkg/bootstrap-vcpkg.shBuildingBuild locally with CMakeNavigate to the root of the repository and create a build directory.mkdir buildConfigurecmaketo usevcpkg.cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="$pwd/vcpkg/scripts/buildsystems/vcpkg.cmake"Build the project.cmake --build buildBuild locally with PythonIt is recommended to use aclean virtual environment.scikit-buildis required before running the installer, as it is the package that takes care of the installation. The rest of dependencies will be installed automatically.pip install scikit-buildInstall the repository. By adding[test]to our install command we can install additionally the test dependencies.pip install .[test]TestingTest the C++ library with Google Testctest --test-dir build/testsTest the python extensionpytestDevelopmentWe try to use the following style guide forpybind11https://developer.lsst.io/pybind11/style.htmlMount Google Drive in Windows Subsystem for Linuxsudo mount -t drvfs G: /mnt/g
acoustics
python-acousticsThepython-acousticsmodule is a Python module with useful tools for acousticians.InstallationThe latest release can be found on PyPI and installed withpip install acoustics. Otherwise, you can clone this repository and install withpip installorpip install -ewhen you want an editable install.ExamplesSeveral examples can be found in theexamplesfolder.TestsThe test suite can be run withpytestDocumentationDocumentation can be foundonline.Licensepython-acousticsis distributed under the BSD 3-clause license. SeeLICENSEfor more information.ContributingContributors are always welcome.
acoustics-hardware
This Python package provides a unified interface to serveral hardware platforms used in acoustic measurements, e.g. audio interfaces. The purpose of this package is twofold, both to enable cross-hardware interactions with a consistent interface, and to simplify scripting of advanced measurement setups.Documentation:http://acoustics-hardware.readthedocs.io/Source code and issue tracker:https://github.com/AppliedAcousticsChalmers/acoustics-hardware
acousticspy
This is a package that I am writing during my time as a graduate student at Brigham Young University. My research is in aeroacoustics, and most of our code is written in MATLAB. Knowing that I may not always have access to MATLAB, and because I enjoy open-source software, I’ve decided to create code in Python that performs many of the same tasks that we regularly perform for research. My dream is that this package can develop to the point where it could realistically be used to do all of the same research that we currently perform in MATLAB.
acoustipy
Investigate and optimize the acoustic performance of porous and microperforate materials with acoustipy. Use the acoustic transfer matrix method to explore new material designs and identify unique properties of existing materials via inverse, indirect, and hybrid optimization schemes.InstallationCreate and activate a new virtual environment (recommended)mkdir <your_env_name> python -m venv .venv cd .venv (Windows) cd Scripts && activate.bat (Linux) source bin/activateInstall from PyPIpip install acoustipyBasic UsageExamples of most of the functionality of acoustipy can be found in the Examples section. The snippet below corresponds to the multilayer structure example and highlights a core feature of acoustipy -- the acoustic transfer matrix method.fromacoustipyimportacousticTMM# Create an AcousticTMM object, specifying a diffuse sound field at 20Cstructure=AcousticTMM(incidence='Diffuse',air_temperature=20)# Define the layers of the material using various modelslayer1=structure.Add_Resistive_Screen(thickness=1,flow_resistivity=100000,porosity=.86)layer2=structure.Add_DBM_Layer(thickness=25.4,flow_resistivity=60000)layer3=structure.Add_Resistive_Screen(thickness=1,flow_resistivity=500000,porosity=.75)# Specify the material backing condition -- in this case a 400mm air gapair=structure.Add_Air_Layer(thickness=400)# Build the total transfer matrix of the structure + air gaptransfer_matrix=structure.assemble_structure(layer1,layer2,layer3,air)# Calculate the frequency dependent narrow band absorption coefficientsabsorption=structure.absorption(transfer_matrix)# Calculate the 3rd octave bands absorption coefficientsbands=structure.octave_bands(absorption)# Calculate the four frequency average absorptionFFA=structure.FFA(bands)# Plot and display the narrow and 3rd band coefficients on the same figurestructure.plot_curve([absorption,bands],["absorption","third octave"])The example below demonstrates another core feature of acoustipy -- optimization routines that are able to identify the JCA model parameters of porous materials from impedance tube measurements. The snippet can also be found under the Inverse Method in the Examples section.fromacoustipyimportacousticTMM,AcousticID# Create an AcousticTMM object to generate toy impedance tube datastructure=acousticTMM(incidence='Normal',air_temperature=20)# Define the JCA and air gap material parameters for the toy datalayer1=structure.Add_JCA_Layer(thickness=30,flow_resistivity=46879,porosity=.93,tortuosity=1.7,viscous_characteristic_length=80,thermal_characteristic_length=105)air=structure.Add_Air_Layer(thickness=375)#Generate rigid backed absorption data and save to a csv files1=structure.assemble_structure(layer1)A1=structure.absorption(s1)structure.to_csv('no_gap',A1)# Generate air backed absorption data and save to a csv files2=structure.assemble_structure(layer1,air)A2=structure.absorption(s2)structure.to_csv('gap',A2)# Create an AcousticID object, specifying to mount types, data files, and data typesinv=AcousticID(mount_type='Dual',no_gap_file="no_gap.csv",gap_file='gap.csv',air_temperature=20,input_type='absorption')# Call the Inverse method to find the tortuosity, viscous, and thermal characteristic lengths of the materialres=inv.Inverse(30,47000,.926,air_gap=375,uncertainty=.2,verbose=True)# Display summary statistics about the optimizationstats=inv.stats(res)print(stats)# Plot the results of the found parameters compared to the toy input datainv.plot_comparison(res)# Save the optimization results to a csvinv.to_csv("params.csv",res)stats={'slope':1.000037058594857,'intercept':9.276088883464206e-05,'r_value':0.9999999674493408,'p_value':0.0,'std_err':8.732362148426126e-06}
acp
# acpacp, anywhere copy’n paste.
acp-calendar
============ACP-Calendar============.. image:: https://badge.fury.io/py/acp-calendar.png:target: https://badge.fury.io/py/acp-calendar.. image:: https://api.travis-ci.org/luiscberrocal/django-acp-calendar.svg?branch=master:target: https://travis-ci.org/luiscberrocal/django-acp-calendar.. image:: https://coveralls.io/repos/github/luiscberrocal/django-acp-calendar/badge.svg?branch=master:target: https://coveralls.io/github/luiscberrocal/django-acp-calendar?branch=master.. image:: https://codeclimate.com/github/luiscberrocal/django-acp-calendar/badges/gpa.svg:target: https://codeclimate.com/github/luiscberrocal/django-acp-calendar:alt: Code Climate.. image:: https://requires.io/github/luiscberrocal/django-acp-calendar/requirements.svg?branch=master:target: https://requires.io/github/luiscberrocal/django-acp-calendar/requirements/?branch=master:alt: Requirements StatusHoliday calendar and date management for the Panama Canal. Includes Panama Canal holidays from 2006 to 2017.Documentation=============The full documentation is at http://django-acp-calendar.readthedocs.io/.Requirements=============As of version 1.7.0 Django 1.8 will no longer be supported due to the fact that the latest Django Restframework versiondoes not support it.Requires* Python 3.4, 3.5 or 3.6* Django 1.9, 1.10 or 1.11.6Quickstart==========Install ACP-Calendar.. code-block:: bash$ pip install acp-calendarOpen your settings file and include acp_calendar and `rest_framework`_ to the THIRD_PARTY_APPS variable on your settingsfile... _rest_framework: http://www.django-rest-framework.org/The settings file.. code-block:: pythonDJANGO_APPS = (# Default Django apps:'django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.sites','django.contrib.messages','django.contrib.staticfiles',# Useful template tags:# 'django.contrib.humanize',# Admin'django.contrib.admin',)THIRD_PARTY_APPS = ('crispy_forms', # Form layouts'allauth', # registration'allauth.account', # registration'allauth.socialaccount', # registration'rest_framework','acp_calendar',)# Apps specific for this project go here.LOCAL_APPS = ('acp_calendar_project.users', # custom users app# Your stuff: custom apps go here)# See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-appsINSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPSAdd the acp_calendar.urls to your urls file... code-block:: pythonurlpatterns = [url(r'^$', TemplateView.as_view(template_name='pages/home.html'), name='home'),url(r'^about/$', TemplateView.as_view(template_name='pages/about.html'), name='about'),# Django Admin, use {% url 'admin:index' %}url(settings.ADMIN_URL, include(admin.site.urls)),# User managementurl(r'^users/', include('acp_calendar_project.users.urls', namespace='users')),url(r'^calendar/', include('acp_calendar.urls', namespace='calendar')),url(r'^accounts/', include('allauth.urls')),# Your stuff: custom urls includes go here] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)Features========Holidays++++++++To get the working days for the Panama Canal between january 1st to january 31st 2016... code-block:: pythonIn [ 3 ]: import datetimeIn [ 4 ]: start_date = datetime.date(2016, 1,1)In [ 5 ]: end_date = datetime.date(2016,1,31)In [ 6 ]: working_days = ACPHoliday.get_working_days(start_date, end_date)In [ 7 ]: print(working_days)19Fiscal Year+++++++++++.. code-block:: pythonIn [ 1 ]: import datetimeIn [ 2 ]: from acp_calendar.models import FiscalYearIn [ 3 ]: start_date = datetime.date(2015, 10,1)In [ 4 ]: fiscal_year = FiscalYear.create_from_date(start_date)In [ 5 ]: print(fiscal_year)FY16In [ 6 ]: fiscal_year.start_dateOut[6]: datetime.date(2015, 10, 1)In [ 7 ]: fiscal_year.end_dateOut[7]: datetime.date(2016, 9, 30)Calculator++++++++++To access the calculator go to http://<your_host>:<your_port>/calendar/calculator/.. image:: docs/images/calculator_01.pngTo use the calculator your base.html must have:* A javascript block at the end of the html* jQuery (version 2.2.x)* jQuery ui (version 1.12.x)Virtual Environment-------------------Use virtualenv to manage a virtual environment.In a Mac use the following command to create the virtual environment... code-block:: bash$ python3 /usr/local/lib/python3.4/site-packages/virtualenv.py --no-site-packages acp_calendar_envRunning Tests-------------Does the code actually work?.. code-block:: bash$ source acp_calendar_env/bin/activate(acp_calendar_env) $ pip install -r requirements-test.txt(acp_calendar_env) $ python runtests.pyBuilds------We are using Travis for continuos integration https://travis-ci.org/luiscberrocal/django-acp-calendar/buildsFor coverage we are using coveralls https://coveralls.io/github/luiscberrocal/django-acp-calendarRun bumpversion.. code-block:: bash$ bumpversion minorInstead of minor you could also use **major** o **patch** depending on the level of the release... code-block:: bashpython setup.py sdist bdist_wheelpython setup.py register -r pypitestpython setup.py sdist upload -r pypitestCheck https://testpypi.python.org/pypi/acp-calendar/.. code-block:: bashpython setup.py register -r pypipython setup.py sdist upload -r pypiDevelopment-----------The development project is in the ./example folder.To use itCredits-------Tools used in rendering this package:* Cookiecutter_* `cookiecutter-pypackage`_.. _Cookiecutter: https://github.com/audreyr/cookiecutter.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackageHistory-------0.2.2 (2016-04-10)++++++++++++++++++* First release on PyPI.
acpibacklight
A python library and script for changing brightness on Linux via acpi. Allows for easing animations too!pipinstallacpibacklightYou can use the scriptacpi-ease-backlightto adjust the backlight with easing via acpi on your device. Seeacpi-ease-backlight--helpfor options.CLI UsageAfter installing via pip, use the scriptacpi-ease-backlight. Here is how you might use it:$acpi-ease-backlight-h# see help...$acpi-ease-backlightshow# show the current backlight value4000$acpi-ease-backlightmax# show the your display's max backlight value4882$acpi-ease-backlightset2000# set the backlight to 2000, over the default# duration of 0.25 seconds and using the default# easing function 'easeOutCubic'$acpi-ease-backlight-d1-eeaseInOutQuadset3000# set the backlight to 3000 over duration of# 1 second, using the easing function 'easeInOutQuad'$acpi-ease-backlight-d0.5dec1000# decrease the current backlight value by# 1000 over a duration of 0.5 secondsLibrary UsageInstantiatingUse the classacpibacklight.AcpiBacklightControlfor changing the backlight level in various ways.AcpiBacklightControlis designed to use pythonwithstatements similarly to file objects and python’sopenbuiltin:fromacpibacklightimportAcpiBacklightControlwithAcpiBacklightControl()asctrl:# set the brightness without animatingctrl.brightness=2000# get max brightness on this devicenew_brightness=ctrl.max# You can also use the animate function on the AcpiBacklightControl.# See the docstring for kwargsctrl.animate(new_brightness,duration=0.75)Alternatively, you can construct, then open, then close theAcpiBacklightControl:ctrl=AcpiBacklightControl()ctrl.open()ctrl.animate(ctrl.brightness-1000)ctrl.close()If you have multiple ACPI backlight devices, specify the name when constructing theAcpiBacklightControl. Otherwise, the default is the first device directory found.ctrl=AcpiBacklightControl(device_dir='intel_backlight')Easing FunctionsYou can pass an easing function to be used inanimate()by theeasing_funckeyword arg. This package usesPyTweeningfor its default animation and the CLI, so you can easily pass one of those:importpytweeningctrl.animate(2345,easing_func=pytweening.easeInOutBounce)Finally, if you want to create and pass your own easing function, it should take one paramater (time) between 0 and 1, and return a value between 0 and 1. For instance, a linear easing function would look like:deflinear_easing(t):# t is always in the range [0, 1]returnt# ...ctrl.animate(1234,easing_func=linear_easing)
acpi-backlight
No description available on PyPI.
acpic
acpic - an acpid clientThis little daemon extendsacpidevent handling capabilities. Normally, event handlers are placed by root in/etc/acpi/events/. With acpic, you can place additional handlers in a per-user~/.config/acpi/events/directory.I personally use it to control PulseAudio with hardware volume buttons on my laptop (seeexamples).InstallationThe easiest way is to installacpicwithpip:$ pip install acpicThen, place your handlers in~/.config/acpi/events/and makeacpicsomehow start when you log in, for example by creating an XDG-compliant entry in~/.config/autostart/acpic.desktop:[Desktop Entry] Name=acpic Comment=acpid event handler TryExec=acpic Exec=acpic Type=ApplicationLicenseCopyright © 2018-2022Piotr ŚliwkaThis work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See theCOPYINGfile for more details.
acpipe-acjson
About the acjson project ...This is a python3 library to produce and process acjson objects.Acjson (assay coordinate java script object notation) is in the big picture a json syntax (http://json.org/) compatible file format, that was developed to capture the most essential experimental annotations of a biological wetlab experiment, how ever simple or complicated the layout may be.In the guts of this file format is each experimental condition described as a single coordinate.Each coordinate is an adaptation of the input-processing-output (IPO) model from software engineering, which is used to describe the structure of an information processing program. In the biological experiment use-case, these are represented by (SPE) sample, perturbation, and assay endpoints, which are represented as three axes.Each of this axis can hold as many sample or reagent records as needed to describe the experimental condition.This library can produce and process such acjson objects.Howto guideHow to install acpipe_acjson?pip3installacpipe_acjsonHow to load the acpipe_acjson library?importacpipe_acjson.acjsonasacHowto get reference information about the implemented constants and functions?importacpipe_acjson.acjsonasac# basic constantsac.ts_ABCac.ts_ACAXISac.ts_NOTCOORac.ts_COORSYSac.d_WELLac.d_RECORDac.d_RECORDLONG# record dictionary add on constantsac.d_SETac.d_EXTERNALIDac.d_SAMPLEac.d_MICROSCOPEac.d_PRIMANTIBODYac.d_SECANTIBODY# leaf constantsac.leafac.es_DATAFRAMELEAF# 96 to 386 well constantesac.dii_96A1ac.dii_96A2ac.dii_96B1ac.dii_96B2# functionhelp(ac.retype)help(ac.escoor)help(ac.icoormax)help(ac.ispotmax)help(ac.ispot)help(ac.xy2icoor)help(ac.acrelabel)help(ac.acbuild)help(ac.acfuseaxisrecord)help(ac.acfusewellrecord)help(ac.acfuserepeat0011)help(ac.acfuserepeat0101)help(ac.acfuseobject)help(ac.acfuse4to1)help(ac.count_record)help(ac.record_in_acjson)help(ac.list_uniq_record)help(ac.max_record)help(ac.pop_record)help(ac.pop_ac)help(ac.xray)help(ac.acjson2layouttsv)help(ac.acjson2dataframetsv)
acplugins4python
UNKNOWN
acpr
Getthese dataforthis mission. Run like so.acpr > acpr.jsonlines
ac-ptk
No description available on PyPI.
acpy
# Accounting Center [![Build Status](https://travis-ci.org/uzh/acpy.svg?branch=master)](https://travis-ci.org/uzh/acpy) [![PyPI version fury.io](https://badge.fury.io/py/acpy.svg)](https://pypi.org/project/acpy/)The Accounting Center (API) aims to provide a stable rest interface for accounting resource usage of clusters and private clouds and managing users of a group/tenant. The idea is that users authenticate on the service using an LDAP compliant account, and can see their own resource usage, and group resource usage. If users are group administrators, they can add/remove users from the group.In some magical way to be defined (probably with a couple of hacky scripts and cron), cluster controllers and cloud controllers will regularly update resource usage using a service account. These controllers will also check (and modify) existing group structures within their respective systems.The package is self contained and has a command line interface. Information regarding the configuration options can be found in the docs. Details regarding the CLI options can be found in the [docs](https://acpy.readthedocs.io/en/latest/) (and by running acpy –help). The application is hosted on port 8080 by default. In production run [nginx](https://www.nginx.com/) in front of it as a reverse proxy, with HTTPS configured (check the [docs](https://acpy.readthedocs.io/en/latest/) for the recommended installation and settings).NOTE: this is all still alpha, only use as a reference for the time being## Installation Either install the package using pip:`bash pip install acpy `or clone this repo and run:`bash pip install-e. `or simply build and run the docker image:`bash docker build-tacpy . docker run-p8080:8080 acpy start `## Using Information regarding available commands:`bash acpy--help`To run the tests:`bash python-mpytest tests/ `To start the service:`bash acpy start `
acpype
ACPYPEAnteChamber PYthon Parser interfacEA tool based inPythonto useAntechamberto generate topologies for chemical compounds and to interface with others python applications like CCPN and ARIA.acpypeis pronounced asace + pipeTopologies files to be generated so far: CNS/XPLOR, GROMACS, CHARMM and AMBER.NB:Topologies generated byacpype/Antechamberare based on General Amber Force Field (GAFF) and should be used only with compatible forcefields like AMBER and its variant.Several flavours of AMBER FF are ported already for GROMACS (seeffamber) as well as to XPLOR/CNS (seexplor-nih) andCHARMM.This code is released underGNU General Public Licence V3.See onlinedocumentationfor more.NO WARRANTY AT ALLIt was inspired by:amb2gmx.pl(Eric Sorin, David Mobley and John Chodera) and depends onAntechamberandOpenBabelYASARA Autosmiles(Elmar Krieger)topolbuild(Bruce Ray)xplo2d(G.J. Kleywegt)For Non-uniform 1-4 scale factor conversion (e.g. if usingGLYCAM06), please cite:BERNARDI, A., FALLER, R., REITH, D., and KIRSCHNER, K. N. ACPYPE update for nonuniform 1–4 scale factors: Conversion of the GLYCAM06 force field from AMBER to GROMACS. SoftwareX 10 (2019), 100241. Doi:10.1016/j.softx.2019.100241ForAntechamber, please cite:WANG, J., WANG, W., KOLLMAN, P. A., and CASE, D. A. Automatic atom type and bond type perception in molecular mechanical calculations. Journal of Molecular Graphics and Modelling 25, 2 (2006), 247–260. Doi:10.1016/j.jmgm.2005.12.005WANG, J., WOLF, R. M., CALDWELL, J. W., KOLLMAN, P. A., and CASE, D. A. Development and testing of a General Amber Force Field. Journal of Computational Chemistry 25, 9 (2004), 1157–1174. Doi:10.1002/jcc.20035If you use this code, I am glad if you cite:SOUSA DA SILVA, A. W. & VRANKEN, W. F. ACPYPE - AnteChamber PYthon Parser interfacE. BMC Research Notes 5 (2012), 367 Doi:10.1186/1756-0500-5-367and (optionally)BATISTA, P. R.; WILTER, A.; DURHAM, E. H. A. B. & PASCUTTI, P. G. Molecular Dynamics Simulations Applied to the Study of Subtypes of HIV-1 Protease. Cell Biochemistry and Biophysics 44 (2006), 395-404. Doi:10.1385/CBB:44:3:395Alan Silva, DScalanwilteratgmaildotcomHow To Use ACPYPEIntroductionWe now have an up-to-dateweb serviceatBio2Byte(but itdoes nothave theamb2gmxfunctionality).To runacpype, locally, with its all functionalities, you needANTECHAMBERfrom packageAmberToolsandOpen Babelif your input files are of PDB format.However, if one wantsacpypejust to emulateamb2gmx.pl, one needs nothing at all butPython.There are several ways of obtainingacpype:ViaCONDA:(It should be wholesome, fully functional, all batteries included)condainstall-cconda-forgeacpypeViaPyPI:If you're using Linux with Intel processors thenpipinstallacpypeis enough and you should have a complete solution. Oterwise ...(Make sure you haveAmberToolsand, optionally but highly recommended,OpenBabel)# You can use conda to get the needed 3rd parties for examplecondacreate-nacpype--channelconda-forgeambertoolsopenbabel# Or for Ubuntu 20:apt-getinstall-yopenbabelpython3-openbabellibarpack++2-devlibgfortran5 pipinstallacpype# or if you feel daringpipinstallgit+https://github.com/alanwilter/acpype.gitNB:If using OpenBabel python module, it's reallyCRITICALto have it installed in the samePythonenvironment ofacpype.By downloading it viagit:(Make sure you haveAmberToolsand, optionally but highly recommended,OpenBabel)# You can use conda to get the needed 3rd parties for examplecondacreate-nacpype--channelconda-forgeambertoolsopenbabel# Or for Ubuntu 20:apt-getinstall-yopenbabelpython3-openbabellibarpack++2-devlibgfortran5 gitclonehttps://github.com/alanwilter/acpype.gitNB:Using this mode, CHARMM topology files will not be generated.ViaDocker:(It should be wholesome, fully functional, all batteries included)If you have Docker installed, you can runacpype_docker.shby:NOTE: first time may take some time as it pulls theacpypedocker image.On Linux / macOS:ln-fsv"$PWD/acpype_docker.sh"/usr/local/bin/acpype_dockerOn Windows: Using Command Prompt:In the directory where theacpype_docker.batfile is found:setx/Mpath"%path%;%cd%"Commands:acpype_docker-iCCCC acpype_docker-itests/DDD.pdb-cgasNB:By installing viacondaor using viadockeryou getAmberTools v.21.11andOpenBabel v3.1.1. OurAmberTools v.21.11is a stripped version from the original containing only the necessary binaries and libraries and comes with thecharmmgenbinary fromAmberTools17in order to generate CHARMM topologies.By installing viapipyou getAmberTools(as described above) embedded. However, the included binaries may not work in your system (library dependencies issues) and with only provide binaries for Linux (Ubuntu20) and macOS (Intel).To Test, if doing viagitAt folderacpype/, type:./run_acpype.py-itests/FFF.pdbIt'll create a folder calledFFF.acpype, and inside it one may find topology files for GROMACS and CNS/XPLOR.Or using a molecule inSMILESnotation:./run_acpype.py-iCCCC# smiles for C4H6 1,3-Butadiene compoundIt'll create a folder calledsmiles_molecule.acpype.To get help and more information, type:./run_acpype.py-hTo InstallAt folderacpype/, type:ln-fsv"$PWD/run_acpype.py"/usr/local/bin/acpypeThen re-login or start another shell session.If viacondaorpip,acpypeshould be in your$PATH.To Verify with GMXGROMACS < v.5.0cdFFF.acpype/ grompp-cFFF_GMX.gro-pFFF_GMX.top-fem.mdp-oem.tpr mdrun-v-deffnmem# And if you have VMDvmdem.groem.trrGROMACS > v.5.0cdFFF.acpype/ gmxgrompp-cFFF_GMX.gro-pFFF_GMX.top-fem.mdp-oem.tpr gmxmdrun-v-deffnmem# And if you have VMDvmdem.groem.trrFor MD, doGROMACS < v.5.0grompp-cem.gro-pFFF_GMX.top-fmd.mdp-omd.tpr mdrun-v-deffnmmd vmdmd.gromd.trrGROMACS > v.5.0gmxgrompp-cem.gro-pFFF_GMX.top-fmd.mdp-omd.tpr gmxmdrun-v-deffnmmd vmdmd.gromd.trrTo Emulateamb2gmx.plFor any givenprmtopandinpcrdfiles (outputs from AMBER LEaP), type:acpype-pFFF_AC.prmtop-xFFF_AC.inpcrdThe output filesFFF_GMX.groandFFF_GMX.topwill be generated inside folderFFF_GMX.amb2gmxTo Verify with CNS/XPLORAt folderFFF.acpype, type:cns<FFF_CNS.inpTo Verify with NAMDseeTutorialNAMD
acq4
ACQ4 is a python-based platform for experimental neurophysiology.It includes support for standard electrophysiology, multiphoton imaging, scanning laser photostimulation, and many other experimental techniques. ACQ4 is highly modular and extensible, allowing support to be added for new types of devices, techniques, user-interface modules, and analyses.
acq400-hapi
No description available on PyPI.