Saravanan666/pypi-org huggingface dataset:
Package: tess-bite
Take a quick bite out of TESS Full Frame Images using HTTP range requests.tess-biteis a user-friendly package which provides fast access to sections of TESS Full-Frame Image (FFI) data.
It uses the HTTP range request mechanism to download only those parts of an FFI that are required
to obtain a cut-out image.Installationpython-mpipinstalltess-biteExample useObtain a Target Pixel File for a stationary object:>>>fromtess_biteimportbite>>>bite("Alpha Cen",shape=(10,10))TargetPixelFile("Alpha Cen")Obtain a Target Pixel File centered on a moving asteroid:>>>fromtess_biteimportbite_asteroid>>>bite_asteroid("Vesta",start="2019-04-28",stop="2019-06-28)TargetPixelFile("Vesta")Obtain a cut-out image from a single FFI:>>>fromtess_biteimportbite_ffi>>>bite_ffi(url,col=50,row=20,shape=(20,20))Quickly download the header of an FFI:>>>fromtess_biteimportbite_header>>>bite_header(url,ext=0)FitsHeaderWhat are HTTP range requests?Tess-bite is powered by theHTTP range requestprotocol.
This is a mechanism which allows a client to request specific bytes from a file on a web server.
For example, downloading a 3-by-3 pixel square of 4-byte pixel values from a TESS image
can be done very quickly using a HTTP request as follows:>>>importhttpx>>>url="https://mast.stsci.edu/portal/Download/file?uri=mast:TESS/product/tess2019142115932-s0012-2-1-0144-s_ffic.fits">>>resp=httpx.get(url,headers={"Range":"bytes=80000-80012,80020-80032,80040-80052"})>>>print(resp.text)--00000000000000000103Content-Type:application/octet-streamContent-Range:bytes80000-80012/35553600DA@DLR½DW˜oD--00000000000000000103Content-Type:application/octet-streamContent-Range:bytes80020-80032/35553600³D.]DªJD--00000000000000000103Content-Type:application/octet-streamContent-Range:bytes80040-80052/35553600D-aöD+W/DRD--00000000000000000103--Of course the difficult part is to translate pixel coordinates to byte positions,
and to convert bytes to pixel values.  Tess-bite takes care of these steps for you!DocumentationComing soon!Similar servicesTESScutis an excellent API service which allows cut outs
to be obtained for stationary objects.  Tess-bite provides an alternative implementation of this
service by leveraging theHTTP range requestsmechanism to download pixel values directly from FFI files.Compared to TESScut, the goal of tess-bite is provide an alternative way to obtain cut-outs which
does not require a central API service, but can instead be run on a local machine or in the cloud.
At this time tess-bite is an experiment, we recommend that you keep using TESScut for now!
Package: tess-cloud
Analyze the TESS open dataset in AWS S3.tess-cloudis a user-friendly package which provides fast access to TESS Full-Frame Image (FFI) data in the cloud.
It builds uponaioboto3,asyncio,
anddiskcacheto access theTESS data set in AWS S3in a fast, asynchronous, and cached way.Installationpython-mpipinstalltess-cloudExample useRetrieve the AWS S3 location of a TESS image:>>>importtess_cloud>>>tess_cloud.get_s3_uri("tess2019199202929-s0014-2-3-0150-s_ffic.fits")"s3://stpubdata/tess/public/ffi/s0014/2019/199/2-3/tess2019199202929-s0014-2-3-0150-s_ffic.fits"List the images of a TESS sector:>>>tess_cloud.list_images(sector=5,camera=2,ccd=3)<TessImageList>Read a TESS image from S3 into local memory:>>>fromtess_cloudimportTessImage>>>img=TessImage("tess2019199202929-s0014-2-3-0150-s_ffic.fits")>>>img.read()<astropy.io.fits.HDUList>Read only the header of a TESS image into local memory:>>>img.read_header(ext=1)<astropy.io.fits.FitsHeader>Cutout a Target Pixel File for a stationary object:>>>fromtess_cloudimportcutout>>>cutout("Alpha Cen",shape=(10,10))TargetPixelFile("Alpha Cen")Cutout a Target Pixel File centered on a moving asteroid:>>>fromtess_cloudimportcutout_asteroid>>>cutout_asteroid("Vesta",start="2019-04-28",stop="2019-06-28)TargetPixelFile("Vesta")DocumentationComing soon!Similar servicesTESScutis an excellent API service which allows cut outs
to be obtained for stationary objects.  Tess-cloud provides an alternative implementation of this
service by leveraging the TESS public data set on AWS S3.At this time tess-cloud is an experiment, we recommend that you keep using TESScut for now!
Package: tessdata
tessdatapipinstallable versions oftesseract-ocr datausageusually you'll want to pick a particular package for installation.currently the following are provided (send a PR to add more!):tessdata.engtessdata.fast-engthese will install to{prefix}/share/tessdata-- you can access this
directory path using thetessdataapi:importtessdataprint(tessdata.data_path())# /path/to/venv/share/tessdata
Package: tessdata.deu
tessdatapipinstallable versions oftesseract-ocr datausageusually you'll want to pick a particular package for installation.currently the following are provided (send a PR to add more!):tessdata.engtessdata.fast-engtessdata.deutessdata.fast-deuthese will install to{prefix}/share/tessdata-- you can access this
directory path using thetessdataapi:importtessdataprint(tessdata.data_path())# /path/to/venv/share/tessdata
Package: tessdata.eng
tessdatapipinstallable versions oftesseract-ocr datausageusually you'll want to pick a particular package for installation.currently the following are provided (send a PR to add more!):tessdata.engtessdata.fast-engthese will install to{prefix}/share/tessdata-- you can access this
directory path using thetessdataapi:importtessdataprint(tessdata.data_path())# /path/to/venv/share/tessdata
Package: tessdata.fast-deu
tessdatapipinstallable versions oftesseract-ocr datausageusually you'll want to pick a particular package for installation.currently the following are provided (send a PR to add more!):tessdata.engtessdata.fast-engtessdata.deutessdata.fast-deuthese will install to{prefix}/share/tessdata-- you can access this
directory path using thetessdataapi:importtessdataprint(tessdata.data_path())# /path/to/venv/share/tessdata
Package: tessdata.fast-eng
tessdatapipinstallable versions oftesseract-ocr datausageusually you'll want to pick a particular package for installation.currently the following are provided (send a PR to add more!):tessdata.engtessdata.fast-engthese will install to{prefix}/share/tessdata-- you can access this
directory path using thetessdataapi:importtessdataprint(tessdata.data_path())# /path/to/venv/share/tessdata
Package: tessdata.fast-jpn
tessdatapipinstallable versions oftesseract-ocr datausageusually you'll want to pick a particular package for installation.currently the following are provided (send a PR to add more!):tessdata.deutessdata.engtessdata.jpntessdata.fast-deutessdata.fast-engtessdata.fast-jpnthese will install to{prefix}/share/tessdata-- you can access this
directory path using thetessdataapi:importtessdataprint(tessdata.data_path())# /path/to/venv/share/tessdata
Package: tessdata.jpn
tessdatapipinstallable versions oftesseract-ocr datausageusually you'll want to pick a particular package for installation.currently the following are provided (send a PR to add more!):tessdata.deutessdata.engtessdata.jpntessdata.fast-deutessdata.fast-engtessdata.fast-jpnthese will install to{prefix}/share/tessdata-- you can access this
directory path using thetessdataapi:importtessdataprint(tessdata.data_path())# /path/to/venv/share/tessdata
Package: tessdb-cmdline
tessdb command line (overview)Linux command line utility.  TESS stands forCristobal Garcia's Telescope Encoder and Sky SensorIt is being used as part of theSTARS4ALL Project.Descriptiontessis a Linux command line utility to perform some common operations on the TESS database without having to write SQL statements. As this utility modifies the database, it is necessary to invoke it within usingsudo. Also, you should ensure that the database is not being written bytessdbsystemd service to avoiddatabase is lockedexceptions, either by using it at daytime or by pausing thetessdbsystemd service with/usr/local/bin/tessdb_pauseand then resume it with/usr/local/bin/tessdb_resume.INSTALLATIONRequirementsThe following components are needed and should be installed first:python 2.7.x (tested on Ubuntu Python 2.7.6) or python 3.6+InstallationInstallation is done from GitHub:git clone https://github.com/astrorafael/tessdb-cmdline.git
cd tess-cmdline
sudo python setup.py installNote:Installation from PyPi is now obsolete. Do not use the package uploaded in PyPi.All executables are copied to/usr/local/binThe database is located at/var/dbase/tess.dbby default, although a diffferent path may be specified.DATA MODELDimensional ModellingThe data model follows the [dimensional modelling]
(https://en.wikipedia.org/wiki/Dimensional_modeling) approach by Ralph Kimball. More references can also be found inStar Schemas.The data modelThe latest version of the data model can be found intessdb-serverrepository.COMMANDSThetesscommand line tool is self-explanatory and has several subcommands. You can find the all by typingtess --helppi@rb-tess:~ $ tess --help
usage: /usr/local/bin/tess [-h] {instrument,location,readings} ...

positional arguments:
  {instrument,location,readings}
    instrument          instrument commands
    location            location commands
    readings            readings commands

optional arguments:
  -h, --help            show this help message and exitEach subcommand has its own help that you may display by issuingtess <subcommand> --helpExample:pi@rb-tess:~ $ tess location list --help
usage: /usr/local/bin/tess location list [-h] [-p PAGE_SIZE] [-d DBASE]

optional arguments:
  -h, --help            show this help message and exit
  -p PAGE_SIZE, --page-size PAGE_SIZE
                        list page size
  -d DBASE, --dbase DBASE
                        SQLite database full file path
Package: tessdb-reports
tessdb-reports (overview)Command line tool and SQL scripts to generate reports from tessdb databasetessdb is a Linux service to collect measurements pubished by TESS Sky Quality Meter via MQTT. TESS stands forCristobal Garcia's Telescope Encoder and Sky Sensortessdbis being used as part of theSTARS4ALL Project.INSTALLATIONLinux installationRequirementsThe following components are needed and should be installed first:python 2.7.x (tested on Ubuntu Python 2.7.6) or python 3.6Note:It is foreseen a Python 3 migration in the future, retaining Python 2.7.x compatibility.InstallationInstallation is done from GitHub:git clone https://github.com/astrorafael/tessdb-reports.git
cd tessdb-reports
sudo python setup.py installNote:Installation from PyPi is now obsolete. Do not use the package uploaded in PyPi.All executables are copied to/usr/local/binThe following required PIP packages will be automatically installed:tabulatepytz (for IDA reports generation)jinja2 (for IDA reports generation)
Package: tess-ephem
Where are Solar System objects located in TESS FFI data?tess-ephemis a user-friendly package which enables users to compute the positions of Solar System objects – asteroids, comets, and planets –
in the data archive of NASA’s TESS Space Telescope.Installationpython-mpipinstalltess-ephemExample usetess-ephem allows you to search the entire archive of TESS FFI’s for the presence
of a known minor planet, and obtain the result as a Pandas DataFrame.
For example:>>>fromtess_ephemimportephem>>>ephem("Sedna")sectorcameraccdcolumnrowtime2018-11-1600:00:00.0005141543.3122961102.8215592018-11-1700:00:00.0005141545.1609101102.8808252018-11-1800:00:00.0005141547.0113511102.934375...2018-12-0900:00:00.0005141584.5854071102.2392922018-12-1000:00:00.0005141586.2452611102.1323042018-12-1100:00:00.0005141587.9063801102.012091You can also obtain the ephemeris for one or more specific times
by passing thetimeparameter:>>>ephem("Sedna",time="2018-11-21 17:35:00")sectorcameraccdcolumnrowtime2018-11-2117:35:00.0005141553.8878381103.048431Additional physical parameters can be obtained by passing theverbose=Trueparameter:>>>ephem("Sedna",time="2018-11-21 17:35:00",verbose=True)sectorcameraccdcolumnrowpixels_per_hourradecvmagsun_distanceobs_distancephase_angletime2018-11-2117:35:00.0005141553.8878381103.0484310.07405457.057867.6372120.61284.94288583.9756890.1419
Package: tesseract
The TesseRACt package is designed to compute concentrations of simulated dark
matter halos from volume info for particles generated using Voronoi tesselation.
This technique is advantageous as it is non-parametric, does not assume
spherical symmetry, and allows for the presence of substructure. For a more
complete description of this technique including a comparison to other
techniques for calculating concentration, please see the accompanying paperLang et al. (2015).This package includes:vorovol: C program for computing the Voronoi diagram of particle data in a number of formats including Gadget-2, Gasoline, binary, and ASCII as well as BGC2 halo catalogues.routines for compiling, running, and parsingvorovoloutputroutines for computing concentrations using particles volumes, traditional fitting to an NFW profile, and non-parametric techniques that assume spherical symmetry.routines and test halos for running many of the performance tests presented inLang et al. (2015).Below are some useful links associated with TesseRACt:PyPI- The most recent stable release.Docs- Tutorials and descriptions of the package modules and functions.Lang et al. (2015)- The accompanying scientific paper.If you would like more information about TesseRACt, please contactMeagan Lang.
Package: tesseract2dict
TESSERACT2DICTThis class contains two main funtions:tess2dict: Input an image and get the extracted text as a dataframe which gives the content, coordinates (x,y,w,h) and confidence of each word. Essentially, it is a wrapper on pytesseract to output a dataframe.word2text: Once you obtain the dataframe, you can pass it through this function along with a bounding box to get the text inside the given box with proper formatting.Prerequisitesbeautifulsoup4MakeTreeDirnumpyopencv-pythonpandaspytesseractTesseract Installation(currently solution works on Tesseract 5.0.0 only)What is Tesseract?For Windowsinstallation linkadding path to path variable (for Tesseract)windows 10windows 7For Linuxsudo apt install tesseract-ocrsudo apt install libtesseract-devInstallationpip install tesseract2dictUsageA sample usage of our solution is shown below. Input an image as numpy.ndarray and the extracted
dataframe at word level is returned.
You can also get the text as plain of a given bounding box with proper formatting using the second function
eg:importcv2fromtesseract2dictimportTessToDicttd=TessToDict()inputImage=cv2.imread('path/to/image.jpg')### function 1word_dict=td.tess2dict(inputImage,'out','outfolder')### function 2text_plain=td.word2text(word_dict,(0,0,inputImage.shape[1],inputImage.shape[0]))AuthorsSreekiran A R-Analytics Consultant, AI Labs, Bridgei2i Analytics Solutions-Github,StackoverflowAnil Prasad M N-Project Manager, AI Labs, Bridgei2i Analytics Solutions-GithubLicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for detailsNOTE: This software depends on other packages that may be licensed under different open source licenses.Useful linkshttp://gwang-cv.github.io/2017/08/25/ubuntu16.04+Tesseract4.0/
Package: tesseractmultiprocessing
Multiprocessing OCR with Tesseractpip install tesseractmultiprocessingWorth using if you:have plenty of different filesare using numpyMulti: 23.9910116One CPU: 100.61128 #pytesseractfromtesseractmultiprocessingimporttesser2dffroma_cv_imwrite_imread_plusimportopen_image_in_cvfromtimeimportperf_counterpicslinks=[r"https://github.com/hansalemaos/screenshots/raw/main/pandsnesteddicthtml.png",r"https://github.com/hansalemaos/screenshots/raw/main/cv2_putTrueTypeText_000000.png",r"https://github.com/hansalemaos/screenshots/raw/main/cv2_putTrueTypeText_000008.png",r"https://github.com/hansalemaos/screenshots/raw/main/cv2_putTrueTypeText_000017.png",]picsunique=[open_image_in_cv(x)forxinpicslinks]pics=[]for_inrange(100):pics.extend(picsunique)start=perf_counter()output=tesser2df(pics,language="eng",pandas_kwargs={"on_bad_lines":"warn"},tesser_args=(),cpus=5,tesser_path=r"C:\Program Files\Tesseract-OCR\tesseract.exe",)print(f"Multi:{perf_counter()-start}")################################################################################importpytesseractpytesseract.pytesseract.tesseract_cmd=r"C:\Program Files\Tesseract-OCR\tesseract.exe"defst():alla=[]forpinpics:alla.append(pytesseract.image_to_data(p))returnallastart=perf_counter()output2=st()print(f"One CPU:{perf_counter()-start}")# Multi: 23.9910116# One CPU: 100.61128# output[0]# Out[4]:# (    level  page_num  block_num  par_num  ...  start_x  start_y  end_x  end_y#  0       1         1          0        0  ...        0        0   1465    654#  1       2         1          1        0  ...      322       64    327    540#  2       3         1          1        1  ...      322       64    327    540#  3       4         1          1        1  ...      322       64    327    540#  4       5         1          1        1  ...      322       64    327    540#  ..    ...       ...        ...      ...  ...      ...      ...    ...    ...#  60      5         1         11        1  ...       14      633   1448    644#  61      2         1         12        0  ...     1445       15   1450    639#  62      3         1         12        1  ...     1445       15   1450    639#  63      4         1         12        1  ...     1445       15   1450    639#  64      5         1         12        1  ...     1445       15   1450    639##  [65 rows x 19 columns],#  array([[[255, 255, 255],#          [255, 255, 255],#          [255, 255, 255],#          ...,#          [255, 255, 255],#          [255, 255, 255],#          [255, 255, 255]],##         [[255, 255, 255],#          [255, 255, 255],#          [255, 255, 255],#          ...,#          [255, 255, 255],#          [255, 255, 255],#          [255, 255, 255]],
Package: tesseract-ocr-utils
OCR utilsPython tools for interacting with TesseractFeaturesDetects tables in PDF/images and performs OCR on each cellPerforms OCR on PDF and generates SVG imageQuick Startfromocr_utilsimportpdf_to_svgpdf_to_svg(input_filename='in.pdf',output_filename='out.svg',detect_tables=True,lang='eng',)Execution exampleInput pdfOutput svgInstallationStable Release:pip install tesseract_ocr_utilsDevelopment Head:pip install git+https://github.com/envinorma/ocr_utils.gitThis library is built uponpytesseractandpdf2imagewhich have non-pip requirements.
Visit these libraries installation pages to install dependencies.For example, on ubuntu, the following libraries need to be installed:apt-getinstalllibarchive13
apt-getinstalltesseract-ocr
apt-getinstallpoppler-utilsDocumentationFor full package documentation please visitenvinorma.github.io/ocr_utils.DevelopmentSeeCONTRIBUTING.mdfor information related to developing the code.MIT license
Package: tesseract-olap
InstallationBesides the main contents of the package, you can install the optional dependencies for the backend driver of your choice:tesseract-olap[clickhouse]Installs the dependency needed to enable the use of thetesseract_olap.backend.clickhousemodule.Getting startedIn its most basic form, the tesseract-olap package provides you with a way to translate OLAP-type queries into request statements that a data backend can understand and execute safely. The results obtained through the execution of server methods are python objects, and as such, can be used in any way the language allows.# example.pyimportasynciofromtesseract_olap.backend.clickhouseimportClickhouseBackendfromtesseract_olapimportOlapServerbackend=ClickhouseBackend("clickhouse://user:pass@localhost:9000/database")server=OlapServer(backend=backend,schema="./path/to/schema.xml")asyncdefget_data():query=DataRequest.new("cube_name",{"drilldowns":["Time","Country"],"measures":["Units","Duration"],})# `result` is an `AsyncIterable` which outputs tidy-data row dictionariesresult=awaitserver.execute(query)# you can handle the result with `async for`returntuple([itemasyncforiteminresult])if__name__=="__main__":asyncio.run(get_data())The server instance can then be used in other programs as the data provider, for simple (like data exploration) and complex (like data processing) operations.© 2022Datawheel, LLC.This project is licensed underMIT.
Package: tesseract-pankaj
Tesseract: Python Minimal Web framework built for learnig purposesTesseract is a Python web framework built for learning purposes.It's a WSGI framework and can be used with any WSGI application server such as Gunicorn.Installationpipinstalltesseract_pankajHow to use itBasic usage:fromtesseract_pankaj.apiimportAPIapp=API()@app.route("/home")defhome(request,response):response.text="Hello from the HOME page"@app.route("/hello/{name}")defgreeting(request,response,name):response.text=f"Hello,{name}"@app.route("/book")classBooksResource:defget(self,req,resp):resp.text="Books Page"defpost(self,req,resp):resp.text="Endpoint to create a book"@app.route("/template")deftemplate_handler(req,resp):resp.body=app.template("index.html",context={"name":"Bumbo","title":"Best Framework"}).encode()Unit TestsThe recommended way of writing unit tests is withpytest. There are two built in fixtures
that you may want to use when writing unit tests with Tesseract. The first one isappwhich is an instance of the mainAPIclass:deftest_route_overlap_throws_exception(app):@app.route("/")defhome(req,resp):resp.text="Welcome Home."withpytest.raises(AssertionError):@app.route("/")defhome2(req,resp):resp.text="Welcome Home2."The other one isclientthat you can use to send HTTP requests to your handlers. It is based on the famousrequests:deftest_parameterized_route(app,client):@app.route("/{name}")defhello(req,resp,name):resp.text=f"hey{name}"assertclient.get("http://testserver/pankaj").text=="hey pankaj"TemplatesThe default folder for templates istemplates. You can change it when initializing the mainAPI()class:app=API(templates_dir="templates_dir_name")Then you can use HTML files in that folder like so in a handler:@app.route("/show/template")defhandler_with_template(req,resp):resp.html=app.template("example.html",context={"title":"Awesome Framework","body":"welcome to the future!"})Static FilesJust like templates, the default folder for static files isstaticand you can override it:app=API(static_dir="static_dir_name")Then you can use the files inside this folder in HTML files:<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><title>{{title}}</title><linkhref="/static/main.css"rel="stylesheet"type="text/css"></head><body><h1>{{body}}</h1><p>This is a paragraph</p></body></html>MiddlewareYou can create custom middleware classes by inheriting from thebumbo.middleware.Middlewareclass and overriding its two methods
that are called before and after each request:fromtesseract_pankaj.apiimportAPIfromtesseract_pankaj.middlewareimportMiddlewareapp=API()classSimpleCustomMiddleware(Middleware):defprocess_request(self,req):print("Before dispatch",req.url)defprocess_response(self,req,res):print("After dispatch",req.url)app.add_middleware(SimpleCustomMiddleware)