Coder Social home page Coder Social logo

mako314 / clipstosheetspython Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 142 KB

I undertook this to help a few streamer clients and their editors. I try to write about most of my projects so I can avoid the hurdles on the run back.

License: MIT License

Python 100.00%
beginner beginner-friendly clips google-sheets-api python python-scripting python3 twitch websockets python3-scripting

clipstosheetspython's Introduction


Twitch to Sheets

Welcome to Clips to Sheets (Python v.0)

Proud to introduce CipsToSheets (CTS), a simple python script solving a major problem. I undertook this project to help a few streamer clients and their editors. I try to write about most of my projects so I can avoid the hurdles on the run back.
The application in itself will not have any major updates in the coming days, however I may update the readMe. I've made some proper documentation on how to use the app from a beginners standpoint.
Explore the docs »

· Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started

About The Project

Smidge advanced

To run the app similar to the image below install Pyinstaller in your IDE

Follow the instructions here and then run the following command inside of a powershell / terminal of your choice inside of the directory that holds the script.py:

I needed to add "python" at the start
python -m PyInstaller --onefile  .\stream_socket.py

Pasted image 20240517103624

(back to top)

Built With

Built with Python 3.10.12

(back to top)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

This setup was built using Python 3.10.12 on Windows 10 Home. It should yield similar results on compatible systems. If you requested the executable version, it will only work if we're on the same OS.

You will need a few tools for this specific setup:

  1. OBS Studio

    • Download and Setup: Download OBS Studio here. Create an account and follow the basic setup instructions.
  2. Twitch

    • Account Setup: Set up a Twitch account. This does not need to be the same email as your Google account. It will post to any Google Sheet as long as it is authorized to do so.
  3. Streamer.bot

    • Download: Get Streamer.bot here. This was the preferred application used by a majority of clients to enable Google Sheets communication.
  4. Google Account

    • Account Creation: Create a Google account.

    • Google Developer Console: Configure your Google Developer Console. Once logged in, your page should resemble the image below: Google Developer Console

    • Create a Project: Name it whatever you like and hit 'Create'.

    • Configure Your Consent Screen:

      • Choose 'External' since 'Internal' requires an organization.
      • Fill out your application name. Consent Screen Setup
      • Developer contact information is required.
      • Scopes: This can be left empty if preferred.
      • Test Users: Very important to add your email (the email hosting the Google Sheet is what I used, but any you have local access to is fine) to the test users list for later adjustments.

Creating Credentials

To create OAuth credentials for your application, follow these steps:

  1. Navigate to the Dashboard: From the Google Developer Console, click on 'Credentials' on the left-hand side menu.

  2. Create OAuth Client ID:

    • Click on 'Create Credentials', then choose 'OAuth Client ID' from the options.
    • Create Credentials
    • Name Your Application & Application Type: Enter a name for your OAuth client that will help you identify it later. Select 'Desktop' from the dropdown. This option is suited for applications running on a user's desktop.
    • Pasted image 20240516195817

This sets up the authentication framework your application will use to interact with Google services.

  1. Download JSON:
    • After creation, download the JSON file.
    • Pasted image 20240516195928
    • The file name will look something like the image below. Rename it to credentials. Include .json if present in the original filename.
    • Pasted image 20240516200021
    • Store it in the same folder as your repository or executable.
  1. Make sure you've completed the ( prerequisites)
  2. Clone the repo
    git clone https://github.com/mako314/ClipsToSheetsPython.git
  3. python3 script_name.py 
    python script_name.py 
    
  4. Grab your "spreadsheet id" and "named range / spread range"

Finding my Spreadsheet Id:

  • First it'll help to explain what the spreadhseet is, and where exactly to find the ID.
  • Pasted image 20240516171035
  • So in the example below, our Spreadsheet Id is: 1sQ_IkgaJls2gpW4zBbSSfuzDnqjqyB_tJ_wIwgvvRHM
  • Pasted image 20240516190147
  • Store it in the same folder as your repository or executable.

Finding my range:

  • I know I specifically state range, but if you'd like a deeper understanding, this is what I'm actually requesting.
    • Pasted image 20240516171102
    • Setting the range you would like rows appended to is easy. You can just click and drag from where you'd like to start. In the example below I start at A2, and I drag my cursor all the way to the cell found in C16:
    • Pasted image 20240516171605
    • our rangename = A2:C16

Okay, but what does that mean?

This is the area that we will be able to make changes to!

so for our example, these are our variables: spreadsheetId = 1sQ_IkgaJls2gpW4zBbSSfuzDnqjqyB_tJ_wIwgvvRHM rangeName = A2:C16

It's okay if you forget them, they're easy reacquire and are replaceable

(back to top)

****:

  • Easy way:
    • Click Import > Paste into the import string box > Import > Close

    • U0JBRR+LCAAAAAAABADNWFlz2zgSft+q+Q9cV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Co02HV17mznlAVMZetL9cL3yNe0kaLJI2acnXL56TpYmx5bigO9TlP9hw/NKwQ6YTingiR3yBQdujtbD6Lms/6FoINE7PQPTE53cNZAL99r6yMYjZkYewl3rJx467PMfLbnPuizaptv1i7GWs8amIUhUl5I8JjvF8xHHMyZ8mQRcsDXu5BkVhF9vvBe7uiUQvaOgIIOnrGTQiQyDYAmTIzGdWhSZRGbn4QEfelT+0DZtIF9/Iwt1bx6bt3GS/8GY+TU8s09HcV4cSPP0U84eLEZ0bKtlJJEqIyaPMwZKQxgWdNSA5+DC+8mOwEa9cES6JNTq5lTi61EgNB+Ri5rF/ehLmWY07PDki0z0cC/v4fixe0WMsZAAA=

    • image

    • Import, close, and ENABLE the command

With the Script Running:

  • If you haven't navigate to the Servers/Clients > Websocket Clients > Right Click the Existing One > Connnect (Optional: Enable auto and reconnect)
    • Pasted image 20240516192259
    • Setting the range you would like rows appended to is easy. You can just click and drag from where you'd like to start. In the example below I start at A2, and I drag my cursor all the way to the cell found in C16:

While streaming and connected to the server, execute the command!

Usage

Timestamp In Use

Timestamp In Use GIF
Description: This GIF demonstrates the practical application of timestamps within the system, showcasing how events are logged and tracked with precision.

Random User Timestamp

Random User Timestamp GIF
Description: This GIF provides a visual walkthrough of a random user's timestamp data, highlighting how it appears and functions within the platform.

Organize Clips By Time

Organize Clips By Time GIF
Description: Observe the organizational features of the system in this GIF, showcasing the methodical sorting of clips by their timestamps for enhanced navigation and efficiency.

For more examples, please refer to the Documentation

(back to top)

Roadmap

  • [ 1 ] Mac Support
  • [ 2 ] Linux support
  • [ 3 ] Add custom message with clip

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Originally I had intended for this project to remain private. However I've taken a turn in the world of building in public. That being said, this will remain free, forever. That being said, I wont't have as much time to maintain this as I'd like. I'm truly passionate about full stack development but I learned a tremendous amount in the development of this app.

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly 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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Discord: makocodesnow
Email: [email protected]
Portfolio: Macolister
LinkedIn: LinkedIn
Project Link: https://github.com/mako314/ClipsToSheetsPython

(back to top)

Acknowledgments

(back to top)

clipstosheetspython's People

Contributors

mako314 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.