The ps package provides an API for querying and manipulating system processes in R. It allows you to list all running processes, get detailed information about specific processes, and perform operations like suspending, resuming, or terminating them.
The package handles process identification safely by tracking both process IDs and creation times to avoid issues with PID reuse. It works across Windows, macOS, and Linux and provides robust handling of finished and zombie processes. The implementation is based on the Python psutil library and includes functions for accessing process attributes like memory usage, CPU time, open files, environment variables, and parent-child relationships.
Contributors#
Resources featuring ps#
Data-level permissions using Posit Connect (with Databricks, Snowflake, OAuth)
Should one viewer of your app be able to see more (or different) data than another? Maybe colleagues in California should only see data relevant to them? Or managers should only have access to their own employee data?
The Connect team joined us for a demo on inheriting data-level permissions using Posit Connect and Databricks Unity Catalog. While this workflow uses Databricks to illustrate federated data access controls, this same methodology can also be applied to Snowflake or any external data source that supports OAuth.
During this workflow demo, you will learn:
- How to define row-level access controls in Databricks Unity Catalog
- How to create a Databricks OAuth integration in Posit Connect
- How to write interactive applications that utilize the viewer’s Databricks credentials when reading data from Databricks Unity Catalog, providing the viewer with a personalized experience depending on their level of data access
- How to deploy this application to Posit Connect and share it within your organization
If you’d like to talk further with our team 1:1 about doing this, you can find a time to chat here: https://posit.co/schedule-a-call/?booking_calendar__c=WorkflowDemo
Ps. To enable OAuth integrations, your team will need to upgrade to Posit Connect 2024.08.0. This feature is available in Enhanced and Advanced product tiers.
Helpful resources for this workflow: Full examples to get you started: https://github.com/posit-dev/posit-sdk-py/tree/main/examples/connect Admins will likely be most interested in starting here: https://docs.posit.co/connect/admin/integrations/oauth-integrations/databricks/ End users will be most interested here: https://docs.posit.co/connect/user/oauth-integrations/ Q&A Link: https://youtube.com/live/TZQY6rm6hU4?feature=share
Additional resources shared: Release Blurb: https://docs.posit.co/connect/news/#posit-connect-2024.08.0 Security: https://docs.posit.co/connect/admin/integrations/oauth-integrations/security.html Publishing Quarto: https://docs.posit.co/connect/how-to/basic/publish-databricks-quarto-notebook/ sparklyr: https://github.com/sparklyr/sparklyr?tab=readme-ov-file#connecting-through-databricks-connect-v2 odbc: https://github.com/r-dbi/odbc?tab=readme-ov-file#odbc-
How to create editable data tables in Shiny for Python
You built a beautiful Shiny app…but someone just asked you where the Excel doc is. Well, what if they had the ability to edit a table within the app, as if it were a spreadsheet?!
Editable tables are a recently developed feature for Shiny for Python, allowing the table itself to become an input value, so your app can react to—and use—the data your user enters.
On Wednesday, July 31st at 11 am, Garrett Grolemund will walk through building a basic app using an editable table and discuss the many potential use cases now enabled.
Helpful links: WSJF App - https://github.com/garrettgman/wsjf-app Interest Calculator App - https://github.com/garrettgman/mortgage-app Value Change App - https://github.com/garrettgman/value-changer-app To do a free trial of Posit Connect: https://pos.it/chat-with-us Posit Connect Cloud: https://connect.posit.cloud/ Q&A Session: https://youtube.com/live/-nG5aco-g84?feature=share
Ps. We host these workflow demo events the last Wednesday of every month! We’d love to have you join us again! You can add it to your calendar here: https://pos.it/team-demo
If you have any questions or suggestions for future sessions, let us know in the comments below :)
#python
How to build a model annotation tool with FastAPI, Quarto & Shiny for Python
Gordon Shotwell, Senior Software Engineer at Posit walks through an end-to-end machine learning workflow with Posit Team. This demo will give you a robust pattern for hosting and sharing models on Connect before you deploy them to a customer-facing system.
This includes
- How and why to use an API layer to serve and authenticate internal models
- Why you should wrap your APIs in Python packages
- Using Shiny for Python to build a data annotation app
- Using Quarto to retrain models on a schedule
Agenda: 11am - Quick introduction 11:02am - Demo 11:40am Q&A Session (https://youtube.com/live/zhN8IZUBCAg?feature=share )
Timestamps: 1:27 - Quick overview of text classification model used in this example 2:15 - Overview of the people that will need to use the model (modellers, leadership, data team, annotators, other systems) 4:11 - Why APIs before UIs is a good rule 5:57 - What about Python packages? 8:23 - Advantages to using an API here 9:18 - Big picture overview of the workflow 11:17 - FastAPI on Posit Connect (Swagger interface) 15:55 - The way this model will be used (authorization by validating user) 19:00 - Building a delightful user experience by wrapping API in a package 25:07 - Quarto report for leadership team showing model statistics & deploying to Connect 26:34 - Retraining the model by scheduling Quarto doc on Connect 28:37 - Shiny for Python app for Annotators (people checking if model is producing correct results & helping improve the model) 35:28 - Overview / summary of this machine learning workflow
Helpful links: Github: https://github.com/gshotwell/connect-e2e-model Anonymous questions: pos.it/demo-questions If you want to book a call with our team to chat more about Posit products: pos.it/chat-with-us Don’t want to meet yet, but curious who else on your team is using Posit? pos.it/connect-us Machine learning workflow with R: https://solutions.posit.co/gallery/bike_predict/
In this month’s Workflows with Posit Team session (Wednesday, November 29th at 11am ET) you will learn how to use Posit Connect as an end-to-end Python platform for hosting internal machine learning models. This will give you a robust pattern for hosting and sharing models on Connect before you deploy them to a customer-facing system.
This will include:
- How and why to use an API layer to serve and authenticate internal models
- Why you should wrap your APIs in Python packages
- Using Shiny for Python to build a data annotation app
- Using Quarto to retrain models on a schedule
During the event, we’ll be joined by Gordon Shotwell, Senior Software Engineer at Posit who will walk us through this end-to-end machine learning workflow with Posit Team.
No registration is required to attend - simply add it to your calendar using this link: pos.it/team-demo
Ps. We host these end-to-end workflow demos on the last Wednesday of every month. If you ever have ideas for topics or questions about them, leave a comment below :)