This tool will automagically convert a table with information about a celestial body to a plain text table in a Google Document.
- AWS account and credentials for use of AWS Textract
- Google Developer app with Google Sheets API enabled and OAuth configured
- Redirect URL of the app should point to the
GET /accessendpoint of the configured server
- Redirect URL of the app should point to the
- Dedicated Google Spreadsheet for writing
- Docker (optionally with docker-compose) installed and working
- Download the application code and build the container with
docker build -t dsp-textract . - Create a persistent local directory to be mounted to the container.
- For docker-compose, this directory must be named
config.local/, this name is recommended
- For docker-compose, this directory must be named
- Optionally create a persistent log directory which will be mapped to
logdirectory in the container- For docker-compose, this directory is named
log
- For docker-compose, this directory is named
- Copy
config/config.local.neon.templatefrom the source code toconfig.local.neonin the local config directory - Point
sheet_client_configandsheet_token_configparameters inconfig.local.neonto files inconfig.local/directory - Set up remaining parameters in
config.local.neonfile - Start the container
- Either with
docker-compose- The application will be exposed on port
8080
- The application will be exposed on port
- Or with
docker runwhere you point your local config directory toconfig.localin the container.- The server in the container runs on port
8080, point wherever you like
- The server in the container runs on port
- Either with
- A server capable of serving PHP pages, PHP 8, composer
- Install composer dependencies
- Create
log,temp/cachedirectories - Set up the server to point to the
publicdirectory of the app - Copy
config/config.local.neon.templatetoconfig/config.local.neonand fill with informationsheet_client_configis a path to Google app config json.- Example value can be
%root_dir%/config/credentials.json
- Example value can be
- Other options should be self-explanatory
%root_dir%can be used to point to the root directory of the app
- Set up Google Docs access token by visiting the
GET /accessendpoint on the configured server - Send your screenshots to the
POST /documentendpoint of the configured server- The endpoint expects a single POST field of name
dataurlwith Base64-encoded data-url of the image
- The endpoint expects a single POST field of name
- It is necessary to provide just a cropped screenshot of the details table, otherwise the result is uncertain
- Very useful tool for this can be CloudShot along with my Generic API Upload Plugin which send exactly the data the app expects
- Each solar system will have a separate sheet in the document
- Each star and planet of the system will take two columns with two empty columns on the right for notes
- The order of bodies on the sheet is Star/Giant/Black hole and then orbiting bodies I-V
- On subsequent screenshots of the same object table, the data of the object will be overwritten
Example Google Spreadsheet from my current playthrough.
- The app is configured for production mode
- To switch the app to a development mode, create a
.devfile in the local config directory - Warning: development mode may leak source code and credentials. Only local use is encouraged. Use lvh.me domain which points to 127.0.0.1 for oauth redirect url and/or the whole app.
