{ "info": { "author": "Vijay Balasubramaniam", "author_email": "vbalasu@gmail.com", "bugtrack_url": null, "classifiers": [ "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "\n# trifacta\n\nTrifacta client that makes it easy to integrate Trifacta into your production and data science workflows\n\n### Usage Scenarios\n- **Jupyter**: Invoke Trifacta jobs from a Jupyter notebook and pass data back and forth between Jupyter and Trifacta\n- **Other Notebooks**: Integrate Trifacta with Azure Databricks, Zepellin or any other notebook-style interface that supports Python\n- **Scripts**: Automate Trifacta jobs and input/output using python scripts that can be easily executed from the command line or called from an external scheduler\n\n### Functionality\nThis library makes it simple to do the following:\n1. Connect to a Trifacta instance\n2. Run a job\n3. Download results to a pandas dataframe OR Download results as text/csv\n4. Upload files to Trifacta\n\nNote that file uploads and downloads are performed using httpfs, and require that port 14000 be opened on the Trifacta server\n\n\n```python\n#!pip install trifacta\nimport trifacta\n```\n\n\n```python\n#Step 1: Connect to Trifacta by providing the URL, username and password\nt = trifacta.Client('https://partnerdemo.trifacta.net', 'userid@mydomain.com', 'mypassword')\n```\n\n#### Get the wrangled dataset id from the URL in the Trifacta UI\nMake sure that you have run the job manually at least once\n![Screenshot_recipe](https://cdn.rawgit.com/vbalasu/trifacta/86890c1f/screenshot_recipe.png)\n\n#### Note the output path (be sure to set it to \"replace\")\n![Run Job](https://cdn.rawgit.com/vbalasu/trifacta/86890c1f/run_job_highlight.png)\n\n\n```python\n#Step 2: Run the job\nt.run_job(14478)\n```\n\n About to run job\n {'jobgroupId': 3926, 'jobIds': [7513, 7514], 'reason': 'JobStarted', 'sessionId': 'b9d327f0-8e19-11e8-8feb-9fabf204e996'}\n 2018-07-22 18:43:01.427594 InProgress\n 2018-07-22 18:43:06.791576 Complete\n\n\n\n\n\n True\n\n\n\n\n```python\n#Step 3a: Get a pandas dataframe with the results\ndf = t.get_dataframe('/trifacta/queryResults/demo@trifacta.com/demo_output.csv')\n```\n\n\n```python\ndf\n```\n\n\n\n\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
NeighborhoodHouseStylerow_countsum_LotArea
0NAmes1Story1591589811
1CollgCr1Story91841644
2Gilbert2Story60668112
3Timber1Story23554694
4CollgCr2Story53546602
5NridgHt1Story51537687
6Sawyer1Story53528438
7Edwards1Story53511296
8NoRidge2Story33485691
9NWAmes1Story35403813
10ClearCr1Story11395797
11Mitchel1Story32394436
12Somerst1Story37350820
13NWAmes2Story29348885
14Somerst2Story49323495
15NridgHt2Story26300685
16OldTown2Story32274465
17SawyerW1Story28271008
18OldTown1.5Fin33267283
19ClearCr1.5Fin6266593
20Crawfor1Story19260639
21SawyerW2Story25255102
22NAmes2Story22249793
23OldTown1Story33240257
24Edwards1.5Fin22228970
25Crawfor2Story20222029
26NAmesSLvl21221177
27Edwards2Story14185799
28Timber1.5Fin2178418
29BrkSide1.5Fin25172233
...............
66CollgCrSLvl330135
67BrDale2Story1628816
68VeenkerSLvl225757
69NoRidge1.5Fin225398
70SawyerWSFoyer325267
71CollgCrSFoyer324491
72MeadowV2Story819611
73NPkVill1Story417942
74Veenker2Story117542
75NAmes1.5Unf216827
76SWISU1Story214692
77OldTownSFoyer214179
78NWAmes1.5Fin113837
79SawyerWSLvl112800
80IDOTRR1.5Unf212449
81SawyerW1.5Fin112327
82Gilbert1.5Fin112134
83BrkSide2.5Unf111888
84Crawfor2.5Fin111526
85NPkVill2Story511465
86NWAmesSFoyer110625
87Crawfor1.5Unf110594
88OldTown1.5Unf29888
89MeadowVSFoyer69853
90SawyerW1.5Unf19000
91MeadowV1Story28448
92IDOTRR2.5Unf17200
93Crawfor2.5Unf17128
94Blueste2Story23250
95MeadowVSLvl11596
\n

96 rows \u00d7 4 columns

\n
\n\n\n\n\n```python\n#Step 3b: Download results as text/csv\nfile_contents = t.get_file_contents('/trifacta/queryResults/demo@trifacta.com/demo_output.csv')\nwith open('demo_output.csv', 'w') as f:\n f.write(file_contents)\n```\n\n\n```python\n#Show the first few rows of the CSV file\n!head demo_output.csv\n```\n\n \"Neighborhood\",\"HouseStyle\",\"row_count\",\"sum_LotArea\"\n \"NAmes\",\"1Story\",\"159\",\"1589811\"\n \"CollgCr\",\"1Story\",\"91\",\"841644\"\n \"Gilbert\",\"2Story\",\"60\",\"668112\"\n \"Timber\",\"1Story\",\"23\",\"554694\"\n \"CollgCr\",\"2Story\",\"53\",\"546602\"\n \"NridgHt\",\"1Story\",\"51\",\"537687\"\n \"Sawyer\",\"1Story\",\"53\",\"528438\"\n \"Edwards\",\"1Story\",\"53\",\"511296\"\n \"NoRidge\",\"2Story\",\"33\",\"485691\"\n\n\n\n```python\n#Step 4: Upload files to Trifacta\nt.put_file_contents('/trifacta/uploads/demo_output.csv', file_contents)\n```\n\n\n\n\n True\n\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/vbalasu/trifacta", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "trifacta", "package_url": "https://pypi.org/project/trifacta/", "platform": "", "project_url": "https://pypi.org/project/trifacta/", "project_urls": { "Homepage": "https://github.com/vbalasu/trifacta" }, "release_url": "https://pypi.org/project/trifacta/1.0.8/", "requires_dist": [ "requests", "pywebhdfs", "pandas" ], "requires_python": "", "summary": "Trifacta client", "version": "1.0.8" }, "last_serial": 4101303, "releases": { "1.0.7": [ { "comment_text": "", "digests": { "md5": "2ec9ffe2d1637c55085de866ea34c1b8", "sha256": "334220aa5ab1aa41c609db02d9978bdfd63948fbfdc59febbebda57d47c302c1" }, "downloads": -1, "filename": "trifacta-1.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "2ec9ffe2d1637c55085de866ea34c1b8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4566, "upload_time": "2018-07-23T13:13:00", "url": "https://files.pythonhosted.org/packages/f9/87/407b7869e9e14b1924c913b4b235c48935023c1f2c75dd5ada144df9f706/trifacta-1.0.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5b272bf14532b90f87994d5cbdef8ec7", "sha256": "051d7053fa851ddee8f64afaf600b59b3b0a546b08178505b5fbc2d8fa8a5c4a" }, "downloads": -1, "filename": "trifacta-1.0.7.tar.gz", "has_sig": false, "md5_digest": "5b272bf14532b90f87994d5cbdef8ec7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5539, "upload_time": "2018-07-23T13:13:02", "url": "https://files.pythonhosted.org/packages/13/f0/efaed66e8532e3ff06efb6571ae3ad0820fd980b0c253e5d14116ab52364/trifacta-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "92b17ed864e09302f537ddb1b314ccf7", "sha256": "c4d7e920f78f1ff96fe059900e76e06b3d3c90eb4512c72d3fd2cb0fcc4e9820" }, "downloads": -1, "filename": "trifacta-1.0.8-py3-none-any.whl", "has_sig": false, "md5_digest": "92b17ed864e09302f537ddb1b314ccf7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4588, "upload_time": "2018-07-25T16:45:29", "url": "https://files.pythonhosted.org/packages/d0/aa/9eff55839183697ea8b9fdb2fadaf0e0261a082caaf21c7ed40635f65039/trifacta-1.0.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aefa91604d3ca8c78d09112b54f6e1aa", "sha256": "fea24a24adf84eaf151886845bc097bd242c6c4fdc65679c133a4647517d7b2c" }, "downloads": -1, "filename": "trifacta-1.0.8.tar.gz", "has_sig": false, "md5_digest": "aefa91604d3ca8c78d09112b54f6e1aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5566, "upload_time": "2018-07-25T16:45:31", "url": "https://files.pythonhosted.org/packages/61/e8/26f6f6890900618c472fe44efb933dc2e3c8400c39833ed42c733c74810b/trifacta-1.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "92b17ed864e09302f537ddb1b314ccf7", "sha256": "c4d7e920f78f1ff96fe059900e76e06b3d3c90eb4512c72d3fd2cb0fcc4e9820" }, "downloads": -1, "filename": "trifacta-1.0.8-py3-none-any.whl", "has_sig": false, "md5_digest": "92b17ed864e09302f537ddb1b314ccf7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4588, "upload_time": "2018-07-25T16:45:29", "url": "https://files.pythonhosted.org/packages/d0/aa/9eff55839183697ea8b9fdb2fadaf0e0261a082caaf21c7ed40635f65039/trifacta-1.0.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aefa91604d3ca8c78d09112b54f6e1aa", "sha256": "fea24a24adf84eaf151886845bc097bd242c6c4fdc65679c133a4647517d7b2c" }, "downloads": -1, "filename": "trifacta-1.0.8.tar.gz", "has_sig": false, "md5_digest": "aefa91604d3ca8c78d09112b54f6e1aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5566, "upload_time": "2018-07-25T16:45:31", "url": "https://files.pythonhosted.org/packages/61/e8/26f6f6890900618c472fe44efb933dc2e3c8400c39833ed42c733c74810b/trifacta-1.0.8.tar.gz" } ] }