Saravanan666/pypi-org huggingface dataset:
Package: asto
astoDeveloper GuideSetup# create conda environment$mambaenvcreate-fenv.yml# update conda environment$mambaenvupdate-nasto--fileenv.ymlInstallpipinstall-e.# install from pypipipinstallastonbdev# activate conda environment$condaactivateasto# make sure the asto package is installed in development mode$pipinstall-e.# make changes under nbs/ directory# ...# compile to have changes apply to the asto package$nbdev_preparePublishing# publish to pypi$nbdev_pypi# publish to conda$nbdev_conda--build_args'-c conda-forge'$nbdev_conda--mambabuild--build_args'-c conda-forge -c dsm-72'UsageInstallationInstall latest from the GitHubrepository:$pipinstallgit+https://github.com/dsm-72/asto.gitor fromconda$condainstall-cdsm-72astoor frompypi$pipinstallastoDocumentationDocumentation can be found hosted on GitHubrepositorypages. Additionally you can find
package manager specific guidelines oncondaandpypirespectively.
Package: astocktrade
import astocktradever1.getdata as ag
ag.get_tradeday(...)
ag.getdatafrombaostock(...)getdata：
get_tradeday:
def get_tradeday(start_str,end_str):
sample: list = get_tradeday('2022-07-01','2022-07-11') #获取20220701至20220711之间所有股票交易日并存入 list 中getdatafrombaostock:
  def getdatafrombaostock(stnamelist,stday,edday,fq,otpath,add_or_rpl): 
  sample: getdatafrombaostock('D\\namelist.csv','2022-07-01','2022-07-11','5','D\\store\\,'new') #获取 D\\namelist.csv 中所有股票20220701至20220711间5分钟k线信息,存入 D\\store\\，为新添
               getdatafrombaostock('D\\namelist.csv','2022-07-01','2022-07-11','5','D\\store\\,'add') #获取 D\\namelist.csv 中所有股票20220701至20220711间5分钟k线信息,存入 D\\store\\，为追加
               注： fq位置为k线频率 d=日k线、w=周、m=月、5=5分钟、15=15分钟、30=30分钟、60=60分钟k线数据，不区分大小写
                       namelist.csv文件包含股票名称的列名应为 ts_code 股票名称形如 sh.xxxxxx 或 sz.xxxxxx 小写字母
                       保存文件名称为对应股票名称 如：sh.600000 保存为 sh.600000.csv

get_alldatebar:
   def get_alldatebar(st,ed,otpath):
   sample:get_alldatebar('2022-07-01','2022-07-11','D\\store\\) #获取20220701至20220711之间每一日大盘全部信息，分日存入D\\store\\

get_tick:
   def get_tick(stock_code) :
   sample: list = get_tick('600000') #获取sh.600000股票实时信息，存入list
   注：list[i]信息包括但不限于 #{i=
                                          # 0 名称
                                          # 1 今开
                                          # 2 昨收
                                          # 3 此时价格
                                          # 4 最高
                                          # 5 最低
                                          # 30 年月天
                                          # 31 时分秒
                                          # ......
                                          # }​
Package: astor
PyPI:https://pypi.org/project/astor/Documentation:https://astor.readthedocs.ioSource:https://github.com/berkerpeksag/astorLicense:3-clause BSDBuild status:astor is designed to allow easy manipulation of Python source via the AST.There are some other similar libraries, but astor focuses on the following areas:Round-trip an AST back to Python[1]:Modified AST doesn’t need linenumbers, ctx, etc. or otherwise
be directly compileable for the round-trip to work.Easy to read generated code as, well, codeCan round-trip two different source trees to compare for functional
differences, using the astor.rtrip tool (for example, after PEP8 edits).Dump pretty-printing of ASTHarder to read than round-tripped code, but more accurate to figure out what
is going on.Easier to read than dump from built-in AST moduleNon-recursive treewalkSometimes you want a recursive treewalk (and astor supports that, starting
at any node on the tree), but sometimes you don’t need to do that.  astor
doesn’t require you to explicitly visit sub-nodes unless you want to:You can add code that executes before a node’s children are visited, and/orYou can add code that executes after a node’s children are visited, and/orYou can add code that executes and keeps the node’s children from being
visited (and optionally visit them yourself via a recursive call)Write functions to access the tree based on object names and/or attribute namesEnjoy easy access to parent node(s) for tree rewriting[1]The decompilation back to Python is based on code originally written
by Armin Ronacher.  Armin’s code was well-structured, but failed on
some obscure corner cases of the Python language (and even more corner
cases when the AST changed on different versions of Python), and its
output arguably had cosmetic issues – for example, it produced
parentheses even in some cases where they were not needed, to
avoid having to reason about precedence.Other derivatives of Armin’s code are floating around, and typically
have fixes for a few corner cases that happened to be noticed by the
maintainers, but most of them have not been tested as thoroughly as
astor.  One exception may be the version of codegenmaintained at github by CensoredUsername.  This has been tested
to work properly on Python 2.7 using astor’s test suite, and, as it
is a single source file, it may be easier to drop into some applications
that do not require astor’s other features or Python 3.x compatibility.
Package: astprettier
astprettierPretty print Python AST nodes, the return value ofast.parseNote:This is a fork ofastpretty. The goals of this fork are:Adding more advanced features that go beyond the REPL scope of astprettyRefactoring and cleanup to make the very small code base easier to understand and maintainExperimentation with Python packaging to make the project directory more beautiful and have less boilerplateInstallationpip install astprettierUsageREPLastprettierprovides two main functions:astprettier.format(node, indent_level=0, indent='    ', show_offsets=True, ns_prefix='')astprettier.print(node, indent_level=0, indent='    ', show_offsets=True, ns_prefix='')astprettier.printis a thin wrapper aroundastprettier.formatthat just writes the output offormattosys.stdout>>>importast,astprettier>>>astprettier.print(ast.parse('if x == y: y += 4').body[0])If(lineno=1,col_offset=0,test=Compare(lineno=1,col_offset=3,left=Name(lineno=1,col_offset=3,id='x',ctx=Load()),ops=[Eq()],comparators=[Name(lineno=1,col_offset=8,id='y',ctx=Load())],),body=[AugAssign(lineno=1,col_offset=11,target=Name(lineno=1,col_offset=11,id='y',ctx=Store()),op=Add(),value=Num(lineno=1,col_offset=16,n=4),),],orelse=[],)>>># Comparison with ast.dump()>>>ast.dump(ast.parse('if x == y: y += 4').body[0])"If(test=Compare(left=Name(id='x', ctx=Load()), ops=[Eq()], comparators=[Name(id='y', ctx=Load())]), body=[AugAssign(target=Name(id='y', ctx=Store()), op=Add(), value=Constant(value=4))], orelse=[])"ns_prefixcontrols whether objects from the ast module will be prefixed with your ast namespace:>>>astprettier.print(ast.parse('x += 5').body[0],show_offsets=False,ns_prefix='ast')ast.AugAssign(target=ast.Name(id='x',ctx=ast.Store()),op=ast.Add(),value=ast.Num(n=5),)ConsoleOn console, you can either pass Python syntax via STDIN or provide a filename.$astprettier-h
usage:astprettier.py[-h][--show-offsets][-n][-iINDENT][-lINDENT_LEVEL][-pNS_PREFIX][-c]filename

positionalarguments:filename

optionalarguments:-h,--helpshowthishelpmessageandexit--show-offsets-n,--no-show-offsets-iINDENT,--indentINDENT-lINDENT_LEVEL,--levelINDENT_LEVEL-pNS_PREFIX,--ns-prefixNS_PREFIX-c,--colorizeastprettiercan optionally colorize the console output with pygments.$echo'x=1'|astprettier-cContributingWe love contributions!astprettier is open source, built on open source, and we'd love to have you hang out in our community.
Package: astpretty
astprettyPretty print the output of python stdlibast.parse.astpretty is intended to be a replacement forast.dump.Installationpip install astprettyUsageastprettyprovides two api functions:astpretty.pprint(node, indent=FOUR_SPACE_INDENT, show_offsets=True)Print a representation of the ast node.>>>astpretty.pprint(ast.parse('if x == y: y += 4').body[0])If(lineno=1,col_offset=0,test=Compare(lineno=1,col_offset=3,left=Name(lineno=1,col_offset=3,id='x',ctx=Load()),ops=[Eq()],comparators=[Name(lineno=1,col_offset=8,id='y',ctx=Load())],),body=[AugAssign(lineno=1,col_offset=11,target=Name(lineno=1,col_offset=11,id='y',ctx=Store()),op=Add(),value=Num(lineno=1,col_offset=16,n=4),),],orelse=[],)indentallows control over the indentation string:>>>astpretty.pprint(ast.parse('if x == y: y += 4').body[0],indent='  ')If(lineno=1,col_offset=0,test=Compare(lineno=1,col_offset=3,left=Name(lineno=1,col_offset=3,id='x',ctx=Load()),ops=[Eq()],comparators=[Name(lineno=1,col_offset=8,id='y',ctx=Load())],),body=[AugAssign(lineno=1,col_offset=11,target=Name(lineno=1,col_offset=11,id='y',ctx=Store()),op=Add(),value=Num(lineno=1,col_offset=16,n=4),),],orelse=[],)show_offsetscontrols whether the output includes line / column information:>>>astpretty.pprint(ast.parse('x += 5').body[0],show_offsets=False)AugAssign(target=Name(id='x',ctx=Store()),op=Add(),value=Num(n=5),)astpretty.pformat(node, indent=FOUR_SPACE_INDENT, show_offsets=True)Return a string representation of the ast node.Arguments are identical toastpretty.pprint.>>>astpretty.pformat(ast.parse('if x == y: y += 4').body[0])"If(\nlineno=1,\ncol_offset=0,\ntest=Compare(\nlineno=1,\ncol_offset=3,\nleft=Name(lineno=1, col_offset=3, id='x', ctx=Load()),\nops=[Eq()],\ncomparators=[Name(lineno=1, col_offset=8, id='y', ctx=Load())],\n),\nbody=[\nAugAssign(\nlineno=1,\ncol_offset=11,\ntarget=Name(lineno=1, col_offset=11, id='y', ctx=Store()),\nop=Add(),\nvalue=Num(lineno=1, col_offset=16, n=4),\n),\n],\norelse=[],\n)"Comparison with stdlibast.dump>>>print(ast.dump(ast.parse('if x == y: y += 4').body[0]))If(test=Compare(left=Name(id='x',ctx=Load()),ops=[Eq()],comparators=[Name(id='y',ctx=Load())]),body=[AugAssign(target=Name(id='y',ctx=Store()),op=Add(),value=Num(n=4))],orelse=[])typed-astsupportastprettyworks withtyped-ast!For usage withtyped-astmake sure you havetyped-astinstalled, a
convenient way to do this is with thetypedextra toastpretty:pipinstallastpretty[typed]The apis above work equally well with the return values from theastmodules
provided bytyped_ast:>>>importastpretty>>>fromtyped_astimportast3>>>astpretty.pprint(ast3.parse('x = 4  # type: int'))Module(body=[Assign(lineno=1,col_offset=0,targets=[Name(lineno=1, col_offset=0, id='x', ctx=Store())],value=Num(lineno=1, col_offset=4, n=4),type_comment='int',),],type_ignores=[],)Withtyped-astinstalled, the commandline interface adds--typed-27and--typed-3options for using the alternative ast parsers:$astpretty--typed-3t.pyModule(body=[Assign(lineno=1,col_offset=0,targets=[Name(lineno=1, col_offset=0, id='x', ctx=Store())],value=Num(lineno=1, col_offset=4, n=4),type_comment='int',),],type_ignores=[],)
Package: astpy
astpy_packageThis is astpy package from Anton Setiazi.
Some function that you can use..convertDateToSQLdictfetchallfirst_day_of_this_monthfirst_day_of_this_yearlast_day_of_this_monthgenerateYearsnamedtuplefetchalloneCursorResultpreviousMonthpreviousMonthWithFirstDatepdf/render_to_pdftoNumberuserMenuFilter
Package: astr
astrPackages that useastrDeveloper GuideSetup# create conda environment$mambaenvcreate-fenv.yml# update conda environment$mambaenvupdate-nastr--fileenv.ymlInstallpipinstall-e.# install from pypipipinstallastrnbdev# activate conda environment$condaactivateastr# make sure the astr package is installed in development mode$pipinstall-e.# make changes under nbs/ directory# ...# compile to have changes apply to the astr package$nbdev_preparePublishing# publish to pypi$nbdev_pypi# publish to conda$nbdev_conda--build_args'-c conda-forge'$nbdev_conda--mambabuild--build_args'-c conda-forge -c dsm-72'UsageInstallationInstall latest from the GitHubrepository:$pipinstallgit+https://github.com/dsm-72/astr.gitor fromconda$condainstall-cdsm-72astror frompypi$pipinstallastrDocumentationDocumentation can be found hosted on GitHubrepositorypages. Additionally you can find
package manager specific guidelines oncondaandpypirespectively.A = AliasC = ClassVarQ = OptionalE = (Over)-EngineeredZ = CustomR = RichP = PlotD = DataB = BioM = Machine Learning
Package: astra-haystack
Astra StoreInstallationinstall astra-haystack package locally to run integration tests:Open in gitpod:Switch Python version to 3.9 (Requires 3.8+ but not 3.12)pyenv install 3.9
pyenv local 3.9Local install for the packagepip install -e .To execute integration tests, add needed environment variablesASTRA_DB_API_ENDPOINT=<id>ASTRA_DB_APPLICATION_TOKEN=<token>and executepython examples/example.pyInstall requirementspip install -r requirements.txtExport environment variablesexport ASTRA_DB_API_ENDPOINT=
export ASTRA_DB_APPLICATION_TOKEN=
export COLLECTION_NAME=
export OPENAI_API_KEY=run the python examplespython example/example.pyorpython example/pipeline_example.pyUsageThis package includes Astra Document Store and Astra Embedding Retriever classes that integrate with Haystack, allowing you to easily perform document retrieval or RAG with Astra, and include those functions in Haystack pipelines.In order to use the Document Store directly:Import the Document Store:from astra_store.document_store import AstraDocumentStore
from haystack.preview.document_stores import DuplicatePolicyLoad in environment variables:api_endpoint = os.getenv("ASTRA_DB_API_ENDPOINT", "")
token = os.getenv("ASTRA_DB_APPLICATION_TOKEN", "")
collection_name = os.getenv("COLLECTION_NAME", "haystack_vector_search")Create the Document Store object:document_store = AstraDocumentStore(
    api_endpoint=api_endpoint,
    token=token,
    collection_name=collection_name,
    duplicates_policy=DuplicatePolicy.SKIP,
    embedding_dim=384,
)Then you can use the document store functions like count_document below:document_store.count_documents()Using the Astra Embedding Retriever with Haystack PipelinesCreate the Document Store object like above, then import and create the Pipeline:from haystack.preview import Pipeline
pipeline = Pipeline()Add your AstraEmbeddingRetriever into the pipelinepipeline.add_component(instance=AstraEmbeddingRetriever(document_store=document_store), name="retriever")Add other components and connect them as desired. Then run your pipeline:pipeline.run(...)
Package: astrality
TL;DR: Automatically deploy dotfiles. Grouped into modules with dynamic behaviour.What does it do?Astrality is a flexible tool for managing configuration files, inspired byGNU
StowandAnsible.Let’s begin with a list of some of Astrality’s key features:Manage and deploy configuration files according to a central YAML config
file.Group related configuration intomodules.Conditionally enable modules based on environment variables, OS, installed
programs and shell commands.Copy and/or symlink files.Execute shell commands.CompileJinja2 templatestemplates to target destinations.Dynamically manipulate context values used during jinja2 compilation.Automatically re-deploy dotfiles when source content is modified.Subscribe to pre-defined events, such as local daylight, and execute actions
accordingly.Fetch modules from GitHub.Restore files created and/or overwritten by modules.Take a look at thetutorialfor managing a dotfile repository, or see thefull documentationfor all available functionality.  Feel free to drop by
ourGitter roomwhen getting started.Here is gif demonstrating how Astrality is used to:Automatically change the desktop wallpaper based on the sun’s position in
the sky.Dynamically change the font size, and implicitly the bar height, ofpolybar.Simultaneously change the color scheme ofalacritty,kitty, and
polybar at the same time.Getting startedPrerequisitesAstrality requirespython 3.6or greater. Check your version by runningpython--version.Installationastrality-gitis published on theAURfor ArchLinux users. Otherwise,
you can install Astrality usingpip:Create a newvirtualenvfor python 3.6 (or use your system python 3.6 if you
prefer). Install Astrality fromPyPIlike so:$python3.6-mpipinstallastralityYou should now be able to startastralityfrom your command line, but first,
let us create an example configuration:$astrality--create-example-configTake a look at the generated example configuration at~/.config/astrality.
Now startastrality:$astralityConfiguration and further documentationI recommend taking a look at thefull documentationof Astrality hosted atRead the Docs.
Package: astralnetworking
A python library to make setting up a multiplayer game more straightforward. The low level bits on the wire are totally abstracted. Higher level options for game state, syncing, client prediction, lag compensation techniques are available but customizable for different projects. My goal for the project is to easily adapt several of my non-networked games to have a multiplayer component with a minimum of special case work on each one.Uses either Chris McCormick’s PodSixNet or Geometrian’s Mastermind networking library for the low level bits. (Both included with the source). Currently built and optimized for the TCP protocol. UDP is a big maybe for later!Current version works well with a demo that syncs the positio of multiple clients, and handles lag issues reliably.The demo uses pygame, but the networking component is completely independant.
Package: astral-projection
astral-projectionLike it's real-world counterpart (if you can call it that), this package allows
your code to have out-of-body experiences. Its effectiveness is also disputed
by experts.Usage:importsysimportosfromastral_projectionimporthostx=23withhost("l3vi.de"):os.system("hostname")print("hello!",x)foriinrange(10):print("hi",i,file=sys.stderr)x+=1print("x is now",x)
Package: ast-refactor
ast-refactorApply structured migrations to existing python source code easily.This is intended to be used to migrate from older code patterns
to modern supported ones.For library authors this can assist in providing migration tools so that
users can migrate to newer versions of your library more easily.ast-refactorwillmodify your source code if you run it, so be sure to
run it on a repository that doesn't have code that is not checked in.Why?When dealing with large codebases it is common to encounter code that is using libraries in ways that are deprecated
(or removed) in newer versions of those libraries.For example you have the following code that uses an older version of pandas (<0.17)df=pd.DataFrame({"A":["foo","foo","foo","foo","foo","bar","bar","bar","bar"],"B":["one","one","one","two","two","one","one","two","two"],"C":["small","large","large","small","small","large","small","small","large"],"D":[1,2,2,3,3,4,5,6,7],"E":[2,4,5,5,6,6,8,9,9]})table=(pd.pivot_table(df,rows=['A','B'],cols=['C'],values='D',aggfunc=np.sum).sort("large"))The second statement uses two pandas functions with deprecated keyword arguments.  You can obviously fix this by hand, but if you have lots of code this is tedious and error prone.ast-refactorprovides you the tools to automatically convert that second statement into something that will work for modern versions of pandas.table=(pd.pivot_table(df,index=['A','B'],columns=['C'],values='D',aggfunc=np.sum).sort_values("large"))This is intended as a tool to help library author and owners of large codebases migrate source code easily.UsageFor detailed usage documentation seeusage docsandwriting a migratorandas a python cliThe easiest way to install this tool is usingpipx.$pipxinstall\ast-refactor

$ast-refactorrunsome/path/or/fileas a docker containerAlternatively you can run it from a docker container$dockerrun\-eUID=$(id-u)\-eGID=$(id-u)\-v/some/path/or/file:/work\flatironhealth/ast-refactor\run\/workBuildinglocally$pipinstall.
$ast-refactorsome/path/or/filedockerdockerbuild-tast-refactor.
Package: astrie
Getting StartedTo get started with using theastriepackage, follow these steps:InstallationInstall the package using pip:pipinstallastrieImportingImport theAsTrieclass from theastriemodule:fromastrieimportAsTrieObject InitializationInitialize an instance of theAsTrieclass:trie=AsTrie()MethodsAdding WordsTo add words to the trie, you can use the following methods:To add a single word:trie.add("Python")To add a list of words at once:word_list=["pineapple","butterfly","adventure","rainbow","whisper","enchantment","tranquility","galaxy","serendipity","blossom","chocolate","meadow","firefly","symphony","serenade","moonlight","horizon","oasis","velvet","reflection","sunrise","wonder","starlight","cascade","mystic","melody","twilight","radiant","journey","destiny","harmony","peaceful","embrace","shimmer","gentle","serene","dreamer","captivate","inspire","tranquility","cherish","ethereal","wanderlust","cherished","radiant","adventure","captivate","radiant","enjoy","serenity","Python","Hello","World"]trie.add_many(word_list)Removing WordsTo remove words from the trie, you can use these methods:To remove a single word:trie.remove("Python")To remove a list of words:trie.remove_many(["Hello","World"])To empty the trie:trie.clear()Checking and CountingYou can perform various checks and obtain counts using these methods:To check if a word exists in the trie:exists=trie.has("horizon")print(exists)>>>TrueTo check if there are words that start with a given prefix:starts_with=trie.starts_with("ad")print(starts_with)>>>TrueTo get the count of words that start with a prefix:starts_with_count=trie.starts_with_count("ad")print(starts_with_count)>>>2To get the count of words equal to a given word:count_equals=trie.count_equals("adventure")print(count_equals)>>>2To get the count of unique words in the trie:unique_count=trie.unique_count()print(unique_count)>>>48Retrieving WordsYou can retrieve words using these methods:To get a generator object for all words in the trie:all_words_generator=trie.all_words()forwordinall_words_generator:print(word)>>>pineapplebutterflyadventure...WorldTo get a generator object for words that start with a prefix:starts_with_generator=trie.words_starts_with("m")forwordinstarts_with_generator:print(word)>>>meadowmelodymoonlightmysticRemember that for generator objects, you need to iterate over them to access the actual words they yield.Note: This trie only works on alphabetical characters. If you want to use intergers typecast them into string before adding them to the trie.
Package: astri-eda
ASTRI EDA Tools1. IP Migration Tool1.1.1 Netlist Extractorimportpathlibimportshutilfromastri_edaimportutilsfromastri_eda.schemaimportLibrary,SpiceParser,Graphfromastri_eda.netlist_loader.read_spiceimportread_spicenetlist_dir='examples/telescopic_ota'netlist_dir='examples/adder'pdk_dir='pdks/FinFET14nm_Mock_PDK/'config_path=pathlib.Path('align/config')topology_dir=pathlib.Path('experiments/1_topology')log_dir='experiments'working_dir=pathlib.Path.cwd().resolve()pdk_dir=pathlib.Path(pdk_dir).resolve()#extract .sp and .const.json files from dirnetlist_files,const_files=utils.extract_input_files(netlist_dir)netlist=netlist_files[0]#build loggerlogger=utils.build_logger(log_dir)subckt=netlist.stem.upper()#name of circuitlogger.info(f"Reading netlist:{subckt}")#delete all files and folders in topology dirshutil.rmtree(topology_dir,ignore_errors=True)topology_dir.mkdir(exist_ok=True)#extract circuits infromation from .sp filelib=read_spice(netlist)#convert subckt to graphgraph1=Graph(lib[0])
Package: astro
Astrodynamics in Pythonastrois Python package to perform basic astrodynamics.Build StatusCode CoverageDocsCitationPyPiInstallationInstallastroby running :pip install astroto install from pypiTo install a development version (for local testing), you can clone the
repository and runpip install-e.from the source directory.DocumentationDocs will be hosted on Read the DocsCitingastroIf you find this package useful it would be very helpful if you can cite it in your work.
You can use the citation link above.DependenciesThere are a limited number of dependencies.
Much ofastrois built on top ofnumpy, which is usually included
in any scientific Python enviornment.
Some additional dependencies are used to offer convient wrappers for
common operations, such as downloading two line element sets or interfacing
with SPICE.numpyspiceypyspacetrackkinematics