ArcGIS Pro Project - Naming Conventions?

552
10
Jump to solution
08-27-2020 12:59 PM
YurikoHashimoto1
New Contributor II

Can someone provide a link or the details regarding ArcGIS Project (*.aprx) naming conventions and file path restrictions? i.e. Is it restricted to alphanumeric and a selection of characters (I know underscores are fine if not encouraged)? Character limits?

Thank you in advance!

Best regards, 

Yuriko

0 Kudos
1 Solution

Accepted Solutions
YurikoHashimoto1
New Contributor II
0 Kudos
10 Replies
DanPatterson
MVP Honored Contributor

Paths explained: Absolute, relative, UNC, and URL—Help | Documentation 

Can't find this in Pro's documentation any more, but it applies.

Then there are a whole load of Wikipedia articles which have links to various Windows documentation plus those of other operating systems

https://www.google.com/search?q=wikipedia+filenames+and+paths&oq=wikipedia+filenames+and+paths&aqs=c...

It is an iffy topic since there are rules and "rules" and it is complicated sometimes by how you intend to access filenames and their paths.  For instance the use of "\" to denote an escape character which causes issues.  See this blog for some issues.

/blogs/dan_patterson/2016/08/14/filenames-and-file-paths-in-python 

The "recommendations" are not to use punctuation, spaces and characters other than letters and numbers.

Further recommendations might include not starting a folder with a number.  The length of the path would be limited by the operating system accessing it (if memory serves)

More to the point... What type of paths do you want to create?  Providing guidance as to whether they are a good idea might be useful


... sort of retired...
YurikoHashimoto1
New Contributor II

Hi Dan, 

Thanks for your prompt response. My question was specifically on ArcGIS Pro Project *aprx file naming restrictions, and whether there is anything specific to APRX files or if they follow Python limits.

For example I had a 140-character count APRX project name that wasn't accepted, so reduced it to 120 characters and it was fine. From what you shared above, can you confirm the restriction was due possibly to the Windows default 260 character MAX, and not to the character limit of the ARPRX Project name?

0 Kudos
DanPatterson
MVP Honored Contributor

My question would be what was in the 20 characters you trimmed?

Python naming convention for sure.  If you are accessing paths through anything, they should be python compliant for the most part... (ie raw encoding... r"c:\a\b\r\t\x\" would fail on multiple conditions... see the blog)

Why such a long path name in the first place would be my second question  if you are the only one having to use the paths.  

An example path you use might be useful


... sort of retired...
0 Kudos
YurikoHashimoto1
New Contributor II

It was just the Latin name of a fish species with nothing but underscores and alpha characters, literally just '_Salvenlinus_alpinus_'. No python filepath restrictions were violated. This is why I wondered if there was a ArcGIS Pro project name character limit.  

0 Kudos
YurikoHashimoto1
New Contributor II

Oh, and the reason for the long name is that it ideally matches a metadata record name which is necessarily long and descriptive as many of these data sources come from published scientific journal articles which are by necessity often very detailed. 

0 Kudos
DanPatterson
MVP Honored Contributor

If it was a filename '_Salvenlinus_alpinus_'

You could drop the pre and post underscores ( _ ) just to be on the safe side. Not exactly sure whether _ "could" be the first character in a filename (not the path), since I wouldn't use it in the first place but if needed

import os.path as op
p = "c:\Temp\_Salvenlinus_alpinus_.txt"
op.isfile(p)

True

not sure for geodatabase featureclasses though


... sort of retired...
0 Kudos
YurikoHashimoto1
New Contributor II

Hi Dan, 

I appreciate the help, but this is just a substring in the middle of a filename. The filename has only alpha characters and underscores. The only thing that changed from Pro accepting the name and not was the length of the name. So I was wondering if there was a filename character length restriction for *.aprx files. But from what you've shared this doesn't seem to be the case. 

Thanks for your help though!

0 Kudos
YurikoHashimoto1
New Contributor II
0 Kudos
DanPatterson
MVP Honored Contributor

good catch!  Hopefully you don't have to type that path and/or filename very often


... sort of retired...